The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
The idea is from SitePoint Forums.
I think a lot of people really want this hack, and I've even seen a released version of it here, but it used cronjobs and stuff like that I'm sure not all of use want to mess with. So, here's my version of the hack, completely crobjob-less and 100% working. The hack also includes an easy way for the admins to change the member of the day at any given time. (see note below) You can see it in action in this board, on the main page in the stats box. To install this hack download the attached file (memberofday.hack.php), upload to your /admin folder and use vbHacker. A couple of notes:
That's it, have fun. Show Your Support
|
Comments |
#212
|
|||
|
|||
<a href="http://foros.animeko.com.mx/memberofday" target="_blank">http://foros.animeko.com.mx/memberofday</a>[1].hack.php
What Happen ! |
#213
|
|||
|
|||
I'm trying to figure out the code necessary to make the words "Member of the Day" appear in the postbit of the MOTD, and I'd appreciate a little help...
I know the code needs to go somewhere in showthread.php. I'm not sure exactly where in the file it should go, but at the very least, I know it needs to start with the same code that the index.php uses: Code:
$getdaytemplate=$DB_site->query_first("SELECT template FROM template WHERE title='memberoftheday' AND templatesetid=-2"); $daytemplate=$getdaytemplate['template']; $daybits=explode('||vb||',$daytemplate); Can someone help make this vision work? I love the idea for the hack but I don't want to install it if I can't have this postbit thing... Boofo? |
#214
|
||||
|
||||
You're trying to make it so that when a member is Member of the Day, it says so in that member's postbit? That would be pretty cool.
|
#215
|
|||
|
|||
|
#216
|
||||
|
||||
How many queries will that add, though? Won't it add a query for each member?
|
#217
|
|||
|
|||
Ooo... yeah, you're right, Boofo. Is there some other way I can code it so that it'll only perform one query?
|
#218
|
||||
|
||||
I'm not really sure how to pull this one off. Give me some time to see what I can come up with.
|
#219
|
|||
|
|||
Never mind... I figured something out myself. Here's what I did... (This assumes you have it installed.)
1. Run the following query: Quote:
Quote:
Code:
$DB_site->query("UPDATE user SET motd='0' WHERE userid=$daybits[1]"); Code:
$DB_site->query("UPDATE template SET template='".addslashes($newtemplate)."' WHERE templatesetid=-2 AND title='memberoftheday'"); Code:
$DB_site->query("UPDATE user SET motd='1' WHERE userid=$newmember[userid]"); Code:
eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";"); Code:
if ($post[motd]) { $motd = "<smallfont><b>Member of the Day!</b></smallfont><br>"; } This not only adds two queries to the home page (which is not good, but better than 25+ more queries on each showthread page) but it allows the Member of the Day to be recorded as a variable in the user table. This might be useful if, say for instance, one wanted to have multiple Members of the Day for some reason. |
#220
|
||||
|
||||
What? Now I'm interested in what I missed.
|
#221
|
||||
|
||||
Does this work?
|
#222
|
|||
|
|||
It works great on my boards...
And just to clarify something. What I did adds two additional queries to the homepage, but those queries only run when the member of the day gets changed (i.e. once a day or whenever the admin adds the parameter) so it shouldn't adversely impact the homepage's regular performance. |
#223
|
||||
|
||||
Extra cool. So those 2 queries are only added on one page view as that's all it takes to switch MOTD. I'm definitely trying to keep queries down on the home page at least...
|
#224
|
|||
|
|||
here's a slight variation for the member of the day hack
I did it on my boards, and it works fine. I modified the code to use the table word from vbulletin. On my forum it's called the word of the day. Some words written from the members are just fun, especially when there are typo for exemple : "Word of the day : pie" |
#225
|
||||
|
||||
Was Vivi Ornitier's emailing idea overlooked, because I think it's a wicked idea and should be considered.
I could actually put it to very good use because of a feature on my forums. |
#226
|
|||
|
|||
will this Member of the day hack work in 2.3.2??
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|