vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Custom Styles Per Forum! (https://vborg.vbsupport.ru/showthread.php?t=1785)

07-19-2000 02:06 AM

I would really appreciate that, thanks. Please keep me posted on any progress you make. To the people who plan on installing this hack, I strongly recommend doing it on a test board, in its current state it can easily whack your vb.

Goldenboy

07-20-2000 10:15 PM

darn. And I was just about to leap. :)

07-21-2000 01:37 AM

Quote:

Originally posted by Stallion
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.

Talk to Ed, he emulated your script

Speaking of which so did I (with some help from ed for the members area stuff) but I'm sure his is alot better, seeing as how I'm new to PHP and all

07-27-2000 08:41 PM

Has anyone been able to fix this function yet? I'd really like to deploy this hack, but can't.

TIA,

Illout.

07-27-2000 10:17 PM

Yes, its finally updated. :-)

Directions:

execute the following mysql command: (if you've already done this in previous installation attempts, don't do it again!)
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;

  $forumspec = "";

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

  $newtext=$vartext;

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

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

  $DB_site->data_seek(0,$replacevars);
  while ($var=$DB_site->fetch_array($replacevars)) {
    $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 (make sure to refresh, this code has been updated)

new step - open up forum/index.php and look for:
Code:

  eval("echo dovars(\"".gettemplate("forumhome")."\");");
directly above it, place:
Code:

  $forumid = "";
start forum/admin/styles.php from your web browser

This _should_ fix all of the problems people were having :)

Please try it out and let me know! Thanks,

[Edited by Stallion on 07-30-2000 at 08:48 PM]

07-30-2000 05:50 PM

Stallion:

I've got it in and working. All forums can have custom styles and that works fine. However, I'm still getting the following error on the main forum page, and any page (member list, search, etc.) that is not a specific forum listed in styles.php - I CAN access those pages now, which is a major improvement over the last version :)

The error is:

Warning: 0 is not a MySQL result index in admin/db_mysql.php on line 82


It doesn't seem to effect operation at all, but I'm curious as to whether or not it's fixable.

Thanks. I really appreciate all the time and effort that's gone into this hack.

07-30-2000 11:51 PM

I updated the dovars section (where you replaced existing global.php code), so you can try that code. The weird thing is, it doesn't seem to work locally, but it *should*.

I don't get the error you reported, so the new update just might work.

07-31-2000 03:08 PM

Yeah, I'm using the new code. It definitely works better than before. One other issue that's cropped up is that running a search returns results using a variety of color schemes. It's pretty funny actually.

Anyway, the hack worked well enough for me to launch the new software. It's still got some rough edges, but I'm working on them.

If you want to see the errors stop by http://illout.com/forums/ the search thing is pretty funny.

Once again, thanks for the hack. It's a lifesaver when you've got lots of forums with custom l&f's.



[Edited by illout on 07-31-2000 at 12:08 PM]

08-21-2000 12:02 AM

To get rid of the error I was getting, I made the following change to the hack above:

Instead of

$forumid = "";

I changed it to

$forumid = "1";

and that did it for the index page. However, I'm having to prepend that line before every echo statement in member.php, memberlist.php, search.php, etc.

Anyone know a way I can do this globally?

Any help appreciated.

01-14-2001 12:28 PM

can someone say me where i can find the styles.php?
the link above don't work :(


All times are GMT. The time now is 07:15 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.01073 seconds
  • Memory Usage 1,744KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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