Welcome to Geeklog, Anonymous Thursday, November 21 2024 @ 10:10 am EST

Geeklog Forums

Mdigest; admin link blinking


Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
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:

Text 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
 Quote

All times are EST. The time is now 10:10 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