Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2003, 06:01 PM
shorty's Avatar
shorty shorty is offline
 
Join Date: Mar 2003
Location: Cambridge, UK
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 07-29-2003, 03:34 AM
mx3's Avatar
mx3 mx3 is offline
 
Join Date: Nov 2002
Location: prescott valley, az
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

// 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.
Reply With Quote
  #3  
Old 07-29-2003, 08:02 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-29-2003, 08:23 AM
shorty's Avatar
shorty shorty is offline
 
Join Date: Mar 2003
Location: Cambridge, UK
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 07-29-2003, 08:39 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 07-29-2003, 08:43 AM
shorty's Avatar
shorty shorty is offline
 
Join Date: Mar 2003
Location: Cambridge, UK
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

... 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!
Reply With Quote
  #7  
Old 07-29-2003, 08:45 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, that's it.

No problem
Reply With Quote
  #8  
Old 07-29-2003, 08:52 AM
shorty's Avatar
shorty shorty is offline
 
Join Date: Mar 2003
Location: Cambridge, UK
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are a genius my friend!

As soon as you are old enough to buy a beer, PM me and Il send the ? necessary!
Reply With Quote
  #9  
Old 07-29-2003, 08:56 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

haha, why thank you very much
Reply With Quote
  #10  
Old 07-29-2003, 11:02 AM
mx3's Avatar
mx3 mx3 is offline
 
Join Date: Nov 2002
Location: prescott valley, az
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10250 seconds
  • Memory Usage 2,259KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete