Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 07-15-2000 Last Update: Never Installs: 0
 
No support by the author.

Yes, its finally here.

No longer will you need to create duplicate templates just to set a few custom colors on the forum level.

I don't have a use myself, but it was heavily requested, so I figured what the heck! Yes Nathan, this will work great with the InfoGrames boards

There are nicers ways of going about this than what I did, but this required the least table modification and code changing, so it should be fine.

This was lightly tested on my test board, and all seemed to work well, but no guarentees. I suggest you backup global.php (main directory, not admin) before making any changes.

Here's how it works:

You go to the style page (styles.php) and it brings up a list of all forums. To the right of those forums are numbers, and they all are equal to 0. Those numbers represent the number of custom style settings represented in that specific board. So if you only change the <body> tag, that number will display 1. If you customize it completely, the number will be higher.

Also, since some forums might only require small changes, those fields which you don't specify will use the installation default (what you set in the existing styles section).

Yea, the interface is pretty ugly and the code isn't much better...but its fast, and it works.

Everything else will be improved upon with time, as long as this thread is as popular as Ed's are!

Directions:

execute the following mysql command:
Code:
ALTER TABLE replacement ADD forumid SMALLINT (5) DEFAULT '0' not null;
if you don't know how, then create replacementfid.php: (in /forum, or /forum/admin)
Code:
<?
require ("global.php");
if (mysql_query("ALTER TABLE replacement ADD forumid SMALLINT (5) DEFAULT '0' not null")) {
print "Success!";
} else {
print "Failed!";
}
?>
open global.php: (in /forum, not /forum/admin)
look for:
Code:
// load vars
$vars=$DB_site->query("SELECT * FROM replacement ORDER BY replacementid DESC");
delete up until:
Code:
// ###################### Start standarderror #######################
place in that spot:
Code:
// ###################### Start dovars #######################
function dovars($vartext,$fid=0) {

  // parses replacement vars

  global $DB_site;
  global $forumid;
  global $vars;

  // load vars

$cusvars=$DB_site->query("SELECT * FROM replacement where forumid = $forumid ORDER BY replacementid DESC");

  $newtext=$vartext;

  $DB_site->data_seek(0,$cusvars);

  $forumspec = "";

  while ($cusvar=$DB_site->fetch_array($cusvars)) {
    $newtext=str_replace($cusvar[findword],$cusvar[replaceword],$newtext);
    $forumspec .= "and findword != '$cusvar[findword]' ";
  }

$vars=$DB_site->query("SELECT * FROM replacement where forumid = 0 $forumspec ORDER BY replacementid DESC");

  $DB_site->data_seek(0,$vars);
  while ($var=$DB_site->fetch_array($vars)) {
    $newtext=str_replace($var[findword],$var[replaceword],$newtext);
  }

  return $newtext;
}
save and close.

create styles.php: (in /forum/admin, not /forum)

update: it appears, since I'm using replacement variables in the code, that this vBulletin installtion is actually replacing the code on the fly. to get the code for styles.php, please go to the following url:
http://unreal2.net/styles.phps

start forum/admin/styles.php from your web browser

Easy enough? Of course...

No demo, since I don't have a use for it, but if Nathan (hint hint) or someone else could put it into use to demonstrate, that'd be great!

[Edited by Stallion on 07-15-2000 at 02:48 AM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-16-2000, 02:01 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Ed Sullivan
That UBB link doesn't work

And I'm pretty sure I know how to do it actually.
Doh, its http://www.unreal2.net/auth

But Ed, we must keep it secret for the vB hackers site we're launching...exclusive technoligy is a Good Thing
Reply With Quote
  #13  
Old 07-16-2000, 04:01 PM
Guest
 
Posts: n/a
Default



How can you validate it when the database isn't on your server? Unless somehow you did an HTTP call and submitted that info to the members area login thingy and checked the response... not sure if I explained that right...

[Edited by JohnM on 07-16-2000 at 01:02 PM]
Reply With Quote
  #14  
Old 07-16-2000, 04:13 PM
Guest
 
Posts: n/a
Default

You've got the right idea...
Reply With Quote
  #15  
Old 07-16-2000, 04:32 PM
Guest
 
Posts: n/a
Default

Stallion,

Your validation script doesn't work for me. However, I've got a leased license - maybe there's another value returned based on license type?

I'd like to be able to DL this file and compare it to the version I've got to potentially eliminate another source of error.

Anyone else try this hack yet?
Reply With Quote
  #16  
Old 07-16-2000, 04:53 PM
Guest
 
Posts: n/a
Default

OK you PHP people, how do you do an HTTP POST call in PHP?

[Edited by JohnM on 07-16-2000 at 03:07 PM]
Reply With Quote
  #17  
Old 07-17-2000, 12:00 AM
Guest
 
Posts: n/a
Default

All right, I've got the hack working now (I had a typo in global.php causing problems). Individual board settings seem to work, but now I'm getting the following error on the main page:

Warning: Offset 0 is invalid for MySQL result index 63 in admin/db_mysql.php on line 108

Every board (except the test board where I've modified via styles.php) shows a variation of that message (different index points.

If anyone has any ideas, I'd love to hear 'em.

Thanks.
Reply With Quote
  #18  
Old 07-18-2000, 11:00 PM
Guest
 
Posts: n/a
Default

Can someone please help with this hack? I installed it and while it has alot of bugs, it also has alot of potential. Could someone that knows php well offer some help with this, I really need this hack.

Goldenboy
Reply With Quote
  #19  
Old 07-18-2000, 11:30 PM
Guest
 
Posts: n/a
Default

Apparently there is something wrong with this hacked function, it causes errors on pages that call it directly, ie. smilies page, index page (when categories only is set), faq etc...

// ###################### Start dovars #######################
function dovars($vartext,$fid=0) {

// parses replacement vars

global $DB_site;
global $forumid;
global $vars;

// load vars

$cusvars=$DB_site->query("SELECT * FROM replacement where forumid = $forumid ORDER BY replacementid DESC");

$newtext=$vartext;

$DB_site->data_seek(0,$cusvars);

$forumspec = "";

while ($cusvar=$DB_site->fetch_array($cusvars)) {
$newtext=str_replace($cusvar[findword],$cusvar[replaceword],$newtext);
$forumspec .= "and findword != '$cusvar[findword]' ";
}

$vars=$DB_site->query("SELECT * FROM replacement where forumid = 0 $forumspec ORDER BY replacementid DESC");

$DB_site->data_seek(0,$vars);
while ($var=$DB_site->fetch_array($vars)) {
$newtext=str_replace($var[findword],$var[replaceword],$newtext);
}

return $newtext;
}


I've tried rewriting this, but I'm not making much progress.

taking out the following line solves the problem illout mentioned.

$DB_site->data_seek(0,$cusvars);

but I'm not sure if thats a vital piece of code or not.

ANY help with this would be much appreciated.

Goldenboy
Reply With Quote
  #20  
Old 07-19-2000, 12:06 AM
Guest
 
Posts: n/a
Default

Stallion,

You validation script dont work for me..!!

George
Reply With Quote
  #21  
Old 07-19-2000, 01:30 AM
Guest
 
Posts: n/a
Default

The authentication page is currently broken, I'll fix it when I have some time. There's no real secret goodies inside it, it was more of a tech test ;-)

And about the above hack, I'll take a look at the problems later tonight (but I'm currently busy with some work, atm(.

Stay tuned.
Reply With Quote
Reply


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 07:56 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.04304 seconds
  • Memory Usage 2,281KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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_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
  • 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