View Full Version : /you, /me, /youid, /myid Hack
Deaths
02-12-2005, 10:00 PM
1.4.2 has been released! Upgrade if /youid and /meid arent working!
To upgrade, just cut (not copy) the youid part above the /you part, and it'll work
This is a hack adds the following BB codes:
"/you" is replaced by the Username viewing the thread*
"/me" is replaced by the thread/post creator*
"/youid" is replaced by the UserID of the user viewing the thread.
"/myid" is replaced by the UserID of the poster of the post.
"/you is great!" Turns into:
Username is great!
"/me" is great!" Turns into:
"Deaths is great!"
"http://www.vbulletin.org/user.php?u=/youid" Turns into:
"http://www.vbulletin.org/user.php?u=123".
"http://www.vbulletin.org/register.php?refferer=/myid" Turns into:
"http://www.vbulletin.org/register.php?refferer=567".
Here are the instructions:
Optionally, you may follow the instructions in install.txt.
Both this post and the .txt file contain the exact same information.
Open includes/functions_bbcodeparse.php:
Find:
$bbcode = str_replace(array('>|||)', '<|||)', '"|||)'), array('>)', '<)','")'), $bbcode);
} // end smilies
Below, add:
// /youid hack by Deaths (Apprentice) | http://www.xgnews.org
global $bbuserinfo;
$bbcode = str_replace("/youid","" .$bbuserinfo['userid']. "",$bbcode);
// End /youid hack
Below that, add:
// /meid hack by Deaths (Apprentice) | http://www.xgnews.org
global $post;
if ('' == $post[userid]) {
global $reputation;
if ('' == $reputation[userid]) {
global $pm;
if ('' == $pm[fromuserid]) {
$meUserid = $bbuserinfo[userid];
} else {
$meUserid = $pm[fromuserid];
}
} else {
$meUserid = $reputation[userid];
}
} else {
$meUserid = $post[userid];
}
$bbcode = str_replace('/meid',"$meUserid", $bbcode);
// End /meid hack
Below that, add:
// /you hack by Deaths (Apprentice) | http://www.xgnews.org
global $bbuserinfo;
$bbcode = str_replace("/you","<font color=\"#2DA72E\"><i>" .$bbuserinfo['username']. "</i></font> ",$bbcode);
// End /you hack
Finally, below that, add:
// /me hack by Deaths (Apprentice) | http://www.xgnews.org
// /me Hack
global $post;
if ('' == $post[username]) {
global $reputation;
if ('' == $reputation[username]) {
global $pm;
if ('' == $pm[fromusername]) {
$meUsername = $bbuserinfo[username];
} else {
$meUsername = $pm[fromusername];
}
} else {
$meUsername = $reputation[username];
}
} else {
$meUsername = $post[username];
}
$bbcode = preg_replace('#^/me (.*)$#im', "<font color=\"red\">* $meUsername \\1 *</font>", $bbcode);
// End /me hack
Now, open newreply.php
Find:
$pagetext = trim(strip_quotes($pagetext));
Below, add:
// /me Hack
$pagetext = preg_replace('#^/me(.*)$#im', "* $originalposter\\1", $pagetext);
// /me Hack
This is my first publicly released hack, so it might be posible that I made a little mistake somewhere in the code, even though, - and maybe because - it is a very simple hack. If so, please post here, heh.
Hope you like it!
*I'm almost positive these hacks have already been released before, even though I couldn't find them.
I did not copy any code from anyone.
However, if you released this hack before I did, and wish to have the /you and /me hacks removed, please contact me by PM.
Guy G
02-13-2005, 04:10 PM
Wow thats kinda cool.
Might install it later..
Good job :)
Deaths
02-13-2005, 04:23 PM
Heh, thanks :).
If you use it, don't forget to click the install button!
buro9
02-13-2005, 07:33 PM
Heh, thanks :).
If you use it, don't forget to click the install button!
Bearing in mind that the bbcodeparse stuff is called from within reputation comments and private messaging as well as the posts and threads... and bearing in mind that you have globalised the $post array... am I correct in assuming that this doesn't work for private messages or reputation comments?
Deaths
02-14-2005, 10:12 AM
I believe PM's use the $post array aswell, but I'm not sure about this.
I cannot check it from where am now, though I will look into this ASAP.
This hack was intended for forum post, not for PM's.
I will look into this though, thank you for the feedback.
MissKalunji
02-17-2005, 01:10 PM
nice
/me clicks install
yoyoyoyo
02-17-2005, 02:42 PM
very nice! I wish I could get this to work in a poll :D I just gave out "Member of the Month" award to /you and now they are all posting acceptance speeches LMAO
Deaths
02-17-2005, 03:12 PM
Heh, I did that aswell a while back, on april fools :).
I'll look into the poll thing, but I don't think BB code is allowed in polls...
buro9
02-17-2005, 07:31 PM
I believe PM's use the $post array aswell, but I'm not sure about this.
I cannot check it from where am now, though I will look into this ASAP.
This hack was intended for forum post, not for PM's.
I will look into this though, thank you for the feedback.
Take inspiration from this snippet I've made on my board:
global $post;
if ('' == $post[username]) {
global $reputation;
if ('' == $reputation[username]) {
global $pm;
if ('' == $pm[fromusername]) {
$meUsername = $bbuserinfo[username];
} else {
$meUsername = $pm[fromusername];
}
} else {
$meUsername = $reputation[username];
}
} else {
$meUsername = $post[username];
}
By the end of that $meUsername contains the correct name for a /me code.
yoyoyoyo
02-17-2005, 07:51 PM
Heh, I did that aswell a while back, on april fools :).
I'll look into the poll thing, but I don't think BB code is allowed in polls...well... I just found out some mods sure can't take a joke :rolleyes:
Deaths
02-19-2005, 12:31 PM
Heh, yoyoyo, I know :)
Deaths
02-19-2005, 12:48 PM
Thanks buro9, added it :)
MicroLinux?
03-01-2005, 02:39 PM
hmm.. is there any reason why this would work when it wants? Like sometimes it works, other times it doesnt.. Sometimes it displays /me sometimes it displays that poster's id... sometimes it displays /you others it says the user's id whose looking at it.. Seems.... weird :/
Deaths
03-01-2005, 02:45 PM
It should work like it should...
Your board is currently offline so I can't test it there, but it should work just fine...
If you can't find out if it works, send me a PM, and I'll look at it.
MicroLinux?
03-01-2005, 04:15 PM
Its online now... go check it out.. plz
Deaths
03-02-2005, 10:45 AM
It's still offline for me...
kcadd
03-12-2005, 10:00 AM
/me installs...
zell_11
03-13-2005, 09:51 AM
// /meid hack by Deaths (Apprentice) | http://www.xgnews.org
// /me Hack
global $post;
if ('' == $post[userid]) {
global $reputation;
if ('' == $reputation[userid]) {
global $pm;
if ('' == $pm[fromuserid]) {
$meUserid = $bbuserinfo[userid];
} else {
$meUserid = $pm[fromuserid];
}
} else {
$meUserid = $reputation[userid];
}
} else {
$meUserid = $post[userid];
}
$bbcode = preg_replace('#^/me (.*)$#im', "$meUserid", $bbcode);
// /me Hack
// End /meid hack
Should be
// /meid hack by Deaths (Apprentice) | http://www.xgnews.org
// /me Hack
global $post;
if ('' == $post[userid]) {
global $reputation;
if ('' == $reputation[userid]) {
global $pm;
if ('' == $pm[fromuserid]) {
$meUserid = $bbuserinfo[userid];
} else {
$meUserid = $pm[fromuserid];
}
} else {
$meUserid = $reputation[userid];
}
} else {
$meUserid = $post[userid];
}
$bbcode = preg_replace('#^/meid (.*)$#im',"<font color=\"red\">* $meUserid \\1 *</font>", $bbcode);
// /me Hack
// End /meid hack
As the poster username and posters id both had /me as the bbcode
Hope this fixes the problems for people
after sorting it i noticed it wouldn't print the rest of the message so i sorted that aswell
Deaths
03-13-2005, 02:34 PM
Thank you for pointing that out zell_11!
I'm suprised no-one noticed it before(including me ^^), and I apoligise for the late update (was on holliday).
shungo
03-14-2005, 11:34 AM
If i use the hack, the text color is not like the rest of the post... how to resolve this pls ? :)
shungo
03-14-2005, 12:16 PM
no needed, i changed it myself :)
Deaths
03-14-2005, 03:22 PM
Glad you could figure it out :).
Boofo
03-20-2005, 09:24 AM
Can you please post a text file with the instructions so others can download it and have a backup if they ever need to re-install the hack? ;)
Deaths
03-20-2005, 10:21 AM
Done.
Boofo
03-20-2005, 10:27 AM
Done.
Thank you, sir. ;)
Deaths
03-20-2005, 10:28 AM
Heh, no problem :D
influence
03-20-2005, 08:00 PM
how come this dont work for thread title?
leeman
03-21-2005, 09:25 AM
Installed and works great ....
Users love it in the shoutbox....
*/me clicks install* ;)
Deaths
03-21-2005, 02:29 PM
Great to hear you like that hack :).
FightRice.com
03-30-2005, 01:23 AM
Is there any way when an unregistered person is viewing the forum to make this automatically just say a name?
Instead of showing up "unregistered"
Deaths
03-30-2005, 06:49 AM
That would be quite hard, as "Unregistered" isn't defined by my hack, but by vB itself...
Dontom
04-01-2005, 05:20 AM
Hi ,
i added
// /you hack by Deaths (Apprentice) | http://www.xgnews.org
global $post;
$bbcode = str_replace("/you ","<font color=\"#2DA72E\"><i>" .$bbuserinfo['username']. "</i></font> ",$bbcode);
// End /you hack
to functions_bbcodeparse but it always shows my name (posters) - any idea?
Dontom
04-01-2005, 05:51 AM
solved - postcache needs to be disabled
Deaths
04-01-2005, 05:52 AM
Hehe, it's April's fool today, have fun with it :D
Deaths
04-01-2005, 11:33 AM
vBadditions has opened today!
All support/bug reports/feature requests will have a higher priority at there!
Deaths
04-01-2005, 11:35 AM
If you wish to validate your license at vBadditions.com, simply follow this following link: http://vbadditions.com/forum/validatenumber.php
After you've followed it, copy the number promted, click the link, and paste the number!
It's that easy!
TyleR
04-01-2005, 11:52 AM
If you wish to validate your license at vBadditions.com, simply follow this following link: http://vbadditions.com/forum/validatenumber.php
After you've followed it, copy the number promted, click the link, and paste the number!
It's that easy!
it said the validation number i gave it was incorrect after pasting it 2 times :(
Deaths
04-01-2005, 11:53 AM
Yes, sorry about that, I forgot about the [url] tags.
Try again now.
EDIT: You must also follow the URL from viewing the single post, click the #36 in the top right corner of the post, then follow it ;)
TyleR
04-01-2005, 11:56 AM
ah just noticed your edit..worked this time :)
Deaths
04-01-2005, 11:57 AM
Hmm, very strange.
I'll take a look at it, hold on.
Deaths
04-01-2005, 12:13 PM
One of our members just validated his license, so it should work.
Could you please try again?
zetetic
04-08-2005, 10:24 PM
I've been using Erwin's /me code (https://vborg.vbsupport.ru/showthread.php?t=59698) for the last year or so, with this modification (https://vborg.vbsupport.ru/showthread.php?p=484334#post484334) which supports private messages, message preview, and bbcode-disabled flags.
I'd like to switch to your hack for the "you" options but I don't want to lose all that. :)
Deaths
04-09-2005, 07:56 AM
Thats why I added each bit of code seporately ;).
You can skip step 2, 4 and 5 to only add the /you codes.
KTBleeding
04-13-2005, 05:05 PM
"/youid" doesn't work for me.
It will display the /you part (the users name) and have id after it in normal text.
Deaths
04-13-2005, 06:27 PM
Sorry about that, some PHP versions parse it differently.
The instructions have been updated, to upgrade, just cut (not copy) the youid part above the /you part, and it'll work.
KTBleeding
04-13-2005, 10:54 PM
Thanks. Seems to be working now. :)
Deaths
04-14-2005, 03:12 PM
No problem ;)
Kaishi
04-24-2005, 01:36 AM
the /me part doesn't work for me :(
KTBleeding
04-24-2005, 01:39 AM
You need to type "/me" and then some sort of a phrase afterwards.
Kaishi
04-24-2005, 04:34 AM
You need to type "/me" and then some sort of a phrase afterwards.
with the quotation marks? and how do i stop the phrase? or am i forced to do a line break?
Deaths
04-24-2005, 10:14 AM
If you only type
/me
it won't work.
You need to type this for example:
/me: pwnz you
Without the :, I just typed that because it wouldnt show up correctly ;)
You can also just type "/me ". (without the quota's)
akanevsky
05-07-2005, 02:26 PM
Cool, esspecially the /meid /youid thingy. Should be part of vbulletin core. *Clicks install.
Deaths
05-07-2005, 06:15 PM
Glad you like it :D
Jamie-UK
06-14-2005, 03:28 PM
Hi, I'm running version 3.0.3
The /you only works when you reply to a thread and see the posts at the bottom of the screen. If you view the thread, it doesn't show *your* ID, it shows mine.
Is there a way I can fix this, without installing a newer version of vBB ? (we have a fair amount of custom code in our current version).
Kind regards,
Jamie.
Deaths
06-25-2005, 06:09 AM
/you is supposed to show your name, not your id.
I don't quite get your error, could you post a link?
csidlernet
07-20-2005, 09:16 AM
thanks man.
paul41598
07-21-2005, 03:44 AM
any way to make this mod available to admins/mods only?!?
akanevsky
07-23-2005, 12:47 PM
Hey... These conditionals of yours... Could be written in a much shorter way. If you do that, I will install it :)
Deaths
08-18-2005, 11:38 AM
any way to make this mod available to admins/mods only?!?
Do you mean only for admins to see, or only for admins to use?
Deaths
08-18-2005, 11:38 AM
Hey... These conditionals of yours... Could be written in a much shorter way. If you do that, I will install it :)
As far as I know this is the most effective way, else they will not show up in PMs/rep. comments/etc..
sonic3d
08-20-2005, 12:09 AM
this conflicts with vBChat hack.
later
sonic
Club3G
10-16-2005, 11:30 PM
this conflicts with vBChat hack.
later
sonic
I'll expand on what he's saying here.
The hack works just fine on my forums, but in vbChat, any time someone IN the chat uses /me, it shows the name of whoever's logged in.
So if I were do a:
* Club3G wishes the chat would work
I'd see:
Chris wishes the chat would work
Bob would see:
Bob wishes the chat would work
Bill would see:
Bill wishes the chat would work
etc. Is there a way to only enable this within posts? Or, alternatively, disable it in other places?
Thanks much!
rungok
03-31-2007, 11:56 AM
Does anyone know how to make this work in v3.6.5? Please... I'm in a hurry. Just hours left.... :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.