vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [you] vbcode (https://vborg.vbsupport.ru/showthread.php?t=49458)

Kars10 03-05-2003 08:32 PM

Quote:

that way mods and admins will see the name in bold and mousing over gives you notice that it's the [you] code
Thats cool!!
Thank you very much!! :)

Boofo 03-05-2003 09:31 PM

Quote:

Originally posted by Mutt
just add those line right after

$bbcode = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $bbcode);

thats it



Thank you. ;)

Quote:

now for you it might be a ton more because you added it to subjects as well.
You created a Monster with this hack. LOL

Boofo 03-05-2003 10:38 PM

Ran into a snag with the replacements that allows for the admins and mods to mouseover the code. Now, if you put [you] between another vbcode (like in the spoiler vbcode hack, it parses the code but makes it go outside the button. Like this code:

[DISABLE][SPOILER=Change this to whatever you like]And it still works. What do you think, [you]? Do you like it?[/SPOILER][/DISABLE]

This part:

Boofo? Do you like it?')">

is outside the spoiler tag now. It parsed the [you] ok (the Boofo part) but throws that and everything after it outside the spoiler tag button. Here is the code I am using in the functions.php:

PHP Code:

    if (in_array($bbuserinfo[usergroupid], array(567))) {
       
$bbcode preg_replace("/(\[)(you)(])/siU""<b><i><a title=\"[you] vbcode\">".$bbuserinfo[username]."</a></i></b>"$bbcode);
    } else if (
$bbuserinfo[userid]>0) {
       
$bbcode preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $bbcode);
    } else {
       
$bbcode preg_replace("/(\[)(you)(])/siU""you"$bbcode);
    } 

Any ideas how to fix that? I like the mouseover and would like to keep it. ;)

dnd 03-05-2003 11:07 PM

Hi

great hack but regarding the addon of the titles the [you] code if only working for the post titles

whin i create a new thread with the title [you] it doesn't show the user name

ex: vb > sports > [you]


any help?

Quote:

Originally posted by Boofo
Ok, here they are. The edits for the thread titles and the post titles. If I forgot to post any other needed areas here, let me know. I also have code needed if you have Logician's Download thread hack, PPN's vb Last title hack and the threadintro hack (by nicksaunders) if anyone needs those fixes.

In functions.php, find:

PHP Code:

    // do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    }
    return 
$retval;


Add this code ABOVE it:

PHP Code:

    if ($bbuserinfo[userid]>0) {
        
$post[title] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $post[title]);
    } else {
        
$post[title] = preg_replace("/(\[)(you)(])/siU""you"$post[title]);
    } 

In forumdisplay.php, find:

PHP Code:

eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 

ABOVE it add:

PHP Code:

    if ($bbuserinfo[userid]>0) {
    
$thread[title] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $thread[title]);
        
$thread[description] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $thread[description]);
    } else {
    
$thread[title] = preg_replace("/(\[)(you)(])/siU""you"$thread[title]);
        
$thread[description] = preg_replace("/(\[)(you)(])/siU""you"$thread[description]);
    } 

In search.php, find:

PHP Code:

      if ($searchresult[attach]>0) {
        
$paperclip="<img src=\"https://vborg.vbsupport.ru/images/paperclip.gif\" alt=\"$searchresult[attach] Attachment(s)\" border=\"0\">";
      } else {
        unset(
$paperclip);
      } 

BELOW it add:

PHP Code:

    if ($bbuserinfo[userid]>0) {
    
$searchresult[pagetext] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[pagetext]);
        
$searchresult[posttitle] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[posttitle]);
        
$searchresult[threadtitle] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[threadtitle]);
    } else {
    
$searchresult[pagetext] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[pagetext]);
        
$searchresult[posttitle] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[posttitle]);
        
$searchresult[threadtitle] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[threadtitle]);
    } 

For the Profile page:

In member.php, find:

PHP Code:

      $getperms=getpermissions($getlastpost[forumid]);
      if (
$getperms[canview]) {
        
$lastposttitle=$getlastpost[title]; 

BELOW it add:

PHP Code:

    if ($bbuserinfo[userid]>0) {
        
$lastposttitle preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $lastposttitle);
    } else {
        
$lastposttitle preg_replace("/(\[)(you)(])/siU""you"$lastposttitle);
    } 



Boofo 03-05-2003 11:15 PM

This is only a small listing of the changes to make to catch all of the places it can pop up. I am still finding them one by one. Are you referring to the navbar?

Here are the ones for the forumdisplay:

--------------------
In forumdisplay.php, find:
--------------------

eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$thread[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[description]);
} else {
$thread[title] = preg_replace("/(\[)(you)(])/siU", "you", $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", "you", $thread[description]);
}

--------------------
Still in forumdisplay.php, find:
--------------------

eval("\$forumbits .= \"".gettemplate("forumdisplay_forumbit_level$depth $tempext")."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$forum[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[description]);
} else {
$forum[title] = preg_replace("/(\[)(you)(])/siU", "you", $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", "you", $forum[description]);
}

--------------------
Still in forumdisplay.php (for the <title>), find:
--------------------

eval("dooutput(\"".gettemplate('forumdisplay')."\" );");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $foruminfo[title]);
} else {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", "you", $foruminfo[title]);
}[/QUOTE]

dnd 03-06-2003 01:27 AM

hi boofo

i mean the navbar which shows above the posts in showthrad.php

DaveRobbo 03-06-2003 08:53 PM

Sheeeeeesh ... this thread is getting hard to read ... are all these extras from page 2 onwards being added back into the original hack txt file? Or do I have to install the hack and then trawl through a kazillion pages of extras?

Davie

Boofo 03-06-2003 09:09 PM

Quote:

Originally posted by dnd
hi boofo

i mean the navbar which shows above the posts in showthrad.php

Here you go. ;)

Quote:

For the forum navbar replacement:

In functions.php, find:
-------------------

function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ;


-------------------
REPLACE it with:
--------------------

function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ,$bbuserinfo;

-------------------
Find:
-------------------

$nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
$nav_title=$foruminfo[title];

-------------------
AFTER it add:
--------------------

if ($bbuserinfo['userid']>0) {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $nav_title));
} else {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", "you", $nav_title));
}

--------------------
In forumdisplay.php, find:
--------------------

eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$thread[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[description]);
} else {
$thread[title] = preg_replace("/(\[)(you)(])/siU", "you", $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", "you", $thread[description]);
}

--------------------
Still in forumdisplay.php, find:
--------------------

eval("\$forumbits .= \"".gettemplate("forumdisplay_forumbit_level$depth $tempext")."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$forum[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[description]);
} else {
$forum[title] = preg_replace("/(\[)(you)(])/siU", "you", $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", "you", $forum[description]);
}

--------------------
Still in forumdisplay.php (for the <title>), find:
--------------------

eval("dooutput(\"".gettemplate('forumdisplay')."\" );");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $foruminfo[title]);
} else {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", "you", $foruminfo[title]);
}

dnd 03-06-2003 10:09 PM

Thanks Boofo

i did that but it only shows the user name in titles on forumsdisplay.php but inside the thread the navbar or the title of the first post shows the code [you] !!

Boofo 03-06-2003 10:26 PM

dnd, this you do this yet?

Quote:

For the forum navbar replacement:

Still in functions.php, find:
-------------------

function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ;


-------------------
REPLACE it with:
--------------------

function makenav($id,$idtype="forum",$highlightlast=1) {
global $DB_site,$nav_url,$nav_title,$session,$threadcache ,$bbuserinfo;

-------------------
Find:
-------------------

$nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
$nav_title=$foruminfo[title];

-------------------
AFTER it add:
--------------------

if ($bbuserinfo['userid']>0) {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $nav_title));
} else {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", "you", $nav_title));
}


All times are GMT. The time now is 06:52 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.01450 seconds
  • Memory Usage 1,821KB
  • 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
  • (9)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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