Welcome to Geeklog Tuesday, November 21 2017 @ 08:43 am EST


Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
Posts: 1569
Location:la rochelle, France
With Mdigest plugin, need to have an admin link blinking as a reminder when a digest is ready to send to users:

PHP Formatted Code
function plugin_getadminoption_mdigest()
{
    global $_CONF, $LANG_MDIGEST, $_TABLES,$_SCRIPTS;

    if (SEC_hasRights('user.mail')) {
        if ($_CONF['emailstories'] == 1) {
            $lastrun = DB_getItem ($_TABLES['vars'], 'value', "name = 'lastemailedstories'");
            $storysql = "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND date >= '{$lastrun}'";
            $result = DB_query ($storysql);
            $count = DB_numRows ($result);
        } else {
            $count = 0;
        }

        if ($count == 0) {
            return array ($LANG_MDIGEST['mdigest'],
                      $_CONF['site_admin_url'] . '/plugins/mdigest/index.php',
                      $count);
        } else {
            $js = " $('.blink').each(function() {
                var elem = $(this);
                setInterval(function() {
                    if (elem.css('visibility') == 'hidden') {
                        elem.css('visibility', 'visible');
                    } else {
                        elem.css('visibility', 'hidden');
                    }    
                }, 500);
            });
            "
;
           
            $_SCRIPTS->setJavaScriptLibrary('jquery');
            $_SCRIPTS->setJavaScript($js, true);
           
            return array ('<strong><span class="blink">' . $LANG_MDIGEST['mdigest'] . '</span></strong>',
                      $_CONF['site_admin_url'] . '/plugins/mdigest/index.php',
                      '<strong>' .  $count . '</strong>');
        }
    }  
}


Cool Ben
I'm available to customise your themes or plugins for your Geeklog CMS

All times are EST. The time is now 08:43 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content