Ticket #170: 20060612 - unified unread count (incomplete).diff

File 20060612 - unified unread count (incomplete).diff, 4.5 kB (added by mdodoo, 2 years ago)

patch for everything except dblclicktoread plugin

  • ajax.php

     
    479479    _ces(id); 
    480480} 
    481481 
    482 function _es(id, state) { 
     482function _es(id, cid, state) { 
    483483        if (document.prevState[id] != null) { 
    484484           // if we click the edit icon while editing cancel the edit 
    485485           _ces(id); 
     
    500500        onCancel = '<?php echo  rss_plugin_hook("rss.plugins.ajax.admindlg.oncancel",""); ?>'.replace(/_ID_/g,id); 
    501501        extraCode = '<?php echo  rss_plugin_hook("rss.plugins.ajax.admindlg",""); ?>'.replace(/_ID_/g,id); 
    502502         
    503   onOk += '_ses('+id+'); return false;'; 
     503  onOk += '_ses('+id+','+cid+'); return false;'; 
    504504    if (!onCancel) { 
    505505        onCancel = '_ces('+id+'); return false;'; 
    506506    } 
     
    549549 
    550550} 
    551551 
    552 function _ses(id) { 
     552function _ses(id,cid) { 
    553553    s = 0; 
    554554    if ((sfu = document.getElementById('sf'+id+'u')) && sfu.checked) { 
    555555      s += <?php echo  RSS_MODE_UNREAD_STATE ?>; 
     
    570570        if ((s & <?php echo  RSS_MODE_UNREAD_STATE ?>) != (p & <?php echo  RSS_MODE_UNREAD_STATE ?>)) { 
    571571            if (s & <?php echo  RSS_MODE_UNREAD_STATE ?>) { 
    572572                setItemClass(id,'item unread'); 
    573                 c=unreadCnt(1); 
     573                c=unreadCnt(1,cid); 
    574574            } else { 
    575                 c = unreadCnt(-1); 
     575                c = unreadCnt(-1,cid); 
    576576                                if ((sel = document.getElementById('<?php echo  SHOW_WHAT ?>')) && 
    577577                                    sel.options[sel.selectedIndex].value == <?php echo  SHOW_UNREAD_ONLY ?>) { 
    578578                        setItemHide(id, (c==0)); 
     
    593593    } 
    594594} 
    595595 
    596 function unreadCnt(d) { 
    597     if (span = document.getElementById('ucnt')) { 
    598         if (c = span.innerHTML.replace(/[^0-9]+/g,"")) { 
    599             c = d+eval(c); 
    600             span.innerHTML = span.innerHTML.replace(/[0-9]+/g,c); 
    601         } 
    602         return c; 
    603     } 
    604     return null; 
     596function unreadCnt(d,channel) { 
     597        e = null; 
     598        channels = document.getElementsByTagName("strong"); 
     599        for(i=0;i<channels.length;i++){ 
     600                if((channels[i].id == 'cid'+channel) || (channels[i].id == 'ucnt')){ 
     601                        if (e = channels[i].innerHTML.replace(/[^0-9]+/g,"")) { 
     602                                e = d+eval(e); 
     603                                channels[i].innerHTML = channels[i].innerHTML.replace(/[0-9]+/g,e); 
     604                                changed = 1; 
     605                        } 
     606                } 
     607        } 
     608        return e; 
    605609} 
    606610 
    607611function _rt(id,rt) { 
  • cls/wrappers/item.php

     
    8686        return $GLOBALS['rss'] -> currentItem -> id; 
    8787} 
    8888 
     89function rss_item_cid() { 
     90        return $GLOBALS['rss'] -> currentItem -> parent -> cid; 
     91} 
     92 
    8993function rss_item_flags() { 
    9094         
    9195        return $GLOBALS['rss'] -> currentItem -> flags; 
  • themes/default/web/item.php

     
    55        </a> 
    66        <?php } ?> 
    77        <?php if(!hidePrivate()) { ?> 
    8         <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
     8        <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
    99                <img src="<?php echo getExternalThemeFile('media/edit.gif'); ?>" alt="edit" /> 
    1010        </a> 
    1111        <?php } ?> 
  • themes/lilina/web/item.php

     
    2828        </a> 
    2929        <?php } ?> 
    3030        <?php if(!hidePrivate()) { ?> 
    31         <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
     31        <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
    3232                <img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" /> 
    3333        </a> 
    3434        <?php } ?> 
     
    7373        </a> 
    7474        <?php } ?> 
    7575        <?php if(!hidePrivate()) { ?> 
    76         <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
     76        <a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;"> 
    7777                <img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" /> 
    7878        </a> 
    7979        <?php } ?>