vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - Unread Posts and Reputation Comments (welcome box) (https://vborg.vbsupport.ru/showthread.php?t=123886)

brvheart 06-21-2007 10:02 PM

ok thanks, I wwas on the right track....I just dont know how to edit the auto template correctly....I tried but had to revert as the regular styles use the navbar and the mobile does not :-/

Could help me out? if not no worries as know you are busy ;)

Paul M 06-21-2007 10:09 PM

I've pretty much told you how above, which part don't you understand ?

brvheart 06-21-2007 10:12 PM

well I am not a coder, I know just enough to do basics.

brvheart 06-21-2007 11:14 PM

Quote:

Originally Posted by Paul M (Post 1273556)
Easiest way is to insert a comment in the header template where you want this to appear (such as <!-- UNREAD -->) and then edit the mods Auto-Template settings to search for that comment.

Edit: Hmm actually, I never put those settings in this mod, so you will have to edit the $search_text variable in the plugin.



Note to self: I must update this.

so can I just the comment variable to look for either place so that it works either way?

example:

PHP Code:

$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar']); 

to:

PHP Code:

$vbulletin->templatecache['navbar''header'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar''header']); 


like I said I am just a novice still learning so that may be way off and a laughable offense ;)

Paul M 06-21-2007 11:37 PM

Laughable offence I'm afraid :D

These two lines ;

PHP Code:

$search_text '</strong><br />';
$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread.'<br />',$vbulletin->templatecache['navbar']); 


... become this ;

PHP Code:

$search_text '<!-- UNREAD -->';
$vbulletin->templatecache['header'] = str_replace($search_text,$search_text.$unread.'<br />',$vbulletin->templatecache['header']); 



And you add <!-- UNREAD --> to your header template, where you want the mod to appear.

brvheart 06-21-2007 11:55 PM

can I make the search text for both the navbar as it is and add for the header so that it works in the regular styles that use the navbar?

brvheart 06-22-2007 12:02 AM

well, I just added your code to the bottom of the plugin....

PHP Code:

$search_text '</strong><br />';
    
$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar']);


        
$search_text '<!-- UNREAD -->';
        
$vbulletin->templatecache['header'] = str_replace($search_text,$search_text.$unread.'<br />',$vbulletin->templatecache['header']); 


or like this and have it still look for <strong>

PHP Code:

$search_text '</strong><br />';
    
$vbulletin->templatecache['navbar'] = str_replace($search_text,$search_text.$unread,$vbulletin->templatecache['navbar']);
    
$vbulletin->templatecache['header'] = str_replace($search_text,$search_text.$unread.'<br />',$vbulletin->templatecache['header']); 


it appears to work, see any issues with doing it like that?....thank you for the help....I hope to get better with this code stuff....but in time ;)



At least I gave you a laughable offense ;)

Paul M 06-22-2007 06:43 AM

There is no real issue with having it as per your first example (where you just added the new code below the existing code) - it means it will still work as intended as well as the extra code for yourself.

brvheart 06-22-2007 11:43 PM

sweet that is what I was after :) thanks Paul you ROCK!!!!

MadKad 06-24-2007 02:27 PM

I have a little proble, when a member registers it tells them that they have something like 24,0000 posts unread, but I relly think it should say you have 0 unread posts as they are new.

Is there a way of sorting this problem out?

I have had this mod installed for a while :)


All times are GMT. The time now is 09:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01303 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete