vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Message of the day hack (https://vborg.vbsupport.ru/showthread.php?t=55688)

shorty 07-28-2003 06:01 PM

Message of the day hack
 
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!

mx3 07-29-2003 03:34 AM

// 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
PHP Code:

<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/showthrea...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

[SQL]
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');
[/SQL]

[SQL]
INSERT INTO `settinggroup` VALUES (32, 'Message of the Day', 32);
[/SQL]

Open up index.php and find:
PHP Code:

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

Above that add:
PHP Code:

  eval("\$messageoftheday = \"".gettemplate('motd')."\";"); 

Create a new template called 'motd' and place in it
Code:

$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;)

mx3 07-29-2003 11:02 AM

Heh...I just put mine in there really fast. assasingod = better. :)

Mine does work, but it is too simple i guess ><


All times are GMT. The time now is 05:41 PM.

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.01275 seconds
  • Memory Usage 1,743KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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