vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Code for specific forums (https://vborg.vbsupport.ru/showthread.php?t=66915)

Berethorn 07-06-2004 05:48 PM

Code for specific forums
 
I have another idea - couldn't find this in the search, so...

I want to have specific code for individual forums, for example a welcome message that appears in X forum, and a different message that appears in Y forum.

An added bonus would be the ability to change the announcements in the AdminCP. :)

Xenon 07-06-2004 05:50 PM

Why not using tempate conditionals in forumdisplay template? :)

Berethorn 07-06-2004 06:26 PM

I will try that, but it would be a long piece of code although certainly that seems to be the easiest way.

But it someone wants to make a mod to allow easy modification for the AdminCP, I think it would be popular. I lack the knowledge to do it myself. :)

Berethorn 07-07-2004 05:58 PM

I found a better and easier way to do this!

First of all, I don't have much php or mySQL know-how, but I guessed, and managed it myself, and it seems to work.

I went to the forum.php file in /admincp and copied all lines of code pertaining to the description box, then renamed the new instances of "description" to "welcome". This gave me a new box and variable in the edit forum page, in the ACP. But when I went to edit that box, I got a mySQL error, so I went to the database, and looked around till I managed to create a new row in the forum table titled welcome.

Then I went to forumdisplay.php, and copied the code regarding the forum 'description', and renamed to 'welcome'.

Then I placed $forum[welcome] in a table in the forumdisplay template, and voila! The text I had written in the ACP now shows on the forumdisplay! Now I don't need 30 lines of < IF > conditionals, and the welcome messages can be changed easily in the forum edit.


I suppose someone could make this into a simple mod, if they knew how to make the database edit from a .php file. :)


All times are GMT. The time now is 07:46 AM.

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.00955 seconds
  • Memory Usage 1,708KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete