View Full Version : Message of the day hack
shorty
07-28-2003, 06:01 PM
Hi..
I've hunted high and low for this really quite simple (I think!) hack...
I just want to be able to enter a message into the admin CP and put a $messageoftheday variable in forumhome :)
Would a simple table in SQL.. an additional template and a basic added PHP page in the admin folder do the trick??
Im no good with PHP and I have really tried but I couldn't get it work.
Anyone got something similar they could share?? :)
Thanks!
// Message of Day by hyper22shadow/mx3
$messageofday="Your message here";
// End message of day by hyper22shadow/mx3
Put that above ?> in index.php
then open forumhome template
<center>$messageofday</center>
place that wherever you want in the forumhome template
All done.
assassingod
07-29-2003, 08:02 AM
That could work, but you would have to hardcode the message in each day.
You could try this, https://vborg.vbsupport.ru/showthread.php?s=&threadid=53170
And if thats still not what you are looking for, I can help.
shorty
07-29-2003, 08:23 AM
Both are nearly there :)
Thanks guys!
Assassin..
If you could knock something quickly.. that would be cool.
The other admins on my site are site owners, they don't have much VBulletin knowledge. Id rather they could just go into the admin CP, click a link and edit a message that is copied onto the forum home :) instead of hoping they can fathom the templates to find the HTML and edit it.
Does that make sense? Its a similar idea to the "quote of the day" type hack. Instead of a random quote, it's just a fixed message that can be edited and changed by admins via the CP.
assassingod
07-29-2003, 08:39 AM
Sure, ok, here's what you do.
Run these 2 queries
INSERT INTO setting (settinggroupid, title, varname, value, description, optioncode, displayorder) VALUES ('32', 'Message of the Day', 'motd', 'Enter your message here.....', 'Enter the message here.','textarea','1');
INSERT INTO `settinggroup` VALUES (32, 'Message of the Day', 32);
Open up index.php and find:
eval("dooutput(\"".gettemplate('forumhome')."\");");
Above that add:
eval("\$messageoftheday = \"".gettemplate('motd')."\";");
Create a new template called 'motd' and place in it
$motd
Then open up the forumhome template and place $messageoftheday anywhere you wish, now all you have do is go to vBOptions in your AdminCP and click on the "Message of the Day" link, and then add your message from there:)
shorty
07-29-2003, 08:43 AM
... and everytime I change the MOTD.. it changes the message??
Just click the option, scrawl the text and hit apply. Poof done?
WOW. You da man :bandit:
Im gonna just run this on my test forum and then Il post back :) thanks assassin!
assassingod
07-29-2003, 08:45 AM
Yep, that's it.
No problem;)
shorty
07-29-2003, 08:52 AM
You are a genius my friend! :)
As soon as you are old enough to buy a beer, PM me and Il send the ? necessary! :D
assassingod
07-29-2003, 08:56 AM
haha, why thank you very much;)
Heh...I just put mine in there really fast. assasingod = better. :)
Mine does work, but it is too simple i guess ><
assassingod
07-29-2003, 11:16 AM
Well there's nothing wrong with yours, but they would have to edit the file, re-upload it each time they want to change it and if they wanted to add some dynamic tags in there then they'd get a parse error.
True. But i'd rather edit the file than edit a template for multiple template sets. Seems faster to me to just re-upload a file.
Bleh...whatever. You are the Ultimate Hacker, i'm just some lazy guy that can hardly code. :p
assassingod
07-29-2003, 11:45 AM
Ah, but you dont have to edit multiple templates, you just have to add the one template per style, or even better you can make the template global, so you only have to add it once and edit it vie vBOptions;)
True...
I have enough trouble using the gettemplate function to use it in a hack request...i always get parse errors or other errors when i try to use it ><
tendo
02-06-2006, 12:19 PM
This doesnt work in 3.5.3 :(
An error occurred while attempting to execute your query. The following information was returned.
error number: 1054
error desc: Unknown column 'settinggroupid' in 'field list'
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.