PDA

View Full Version : Admin can change default style from admin cp


Brad
03-19-2003, 10:00 PM
This is a simple 'mini hack'. I wrote this for myself some time ago so i could change the default style without overwriting styleid 1, or editing global.php multiple times.

This will add a new option in the 'vBulletin options' part of the admin cp.

Querys to run: 1
Files to edit: 1.
Screenshot: in next post.

Brad
03-20-2003, 02:23 AM
Screenshot of new admin option:

squawell
03-20-2003, 02:30 AM
useful hack!!

/me installed!!

Link14716
03-20-2003, 02:33 AM
Useful.. I have no real use for it yet, but it will come in handy in the future.

* Link14716 licks install anyways... :)

Rose
03-20-2003, 02:36 AM
SWEEET! Thanks, Anime-loo!

Brad
03-20-2003, 02:44 AM
Thanks all, i may release anthor version that will show the styles in a drop down, but not until i finish my style by day of the week hack :).

PSI|Dr-X
03-20-2003, 01:04 PM
I really needed this

*Clicks Install

Dean C
03-20-2003, 02:23 PM
Alleluia - i've been waiting for this for so long now :) Can you make it so its a dropdown list of styles instead :D?

- miSt

Brad
03-20-2003, 06:21 PM
Mist: Sure, ill look into it as soon as im done with my next hack (probbly tonight) :)

mforster
03-21-2003, 09:47 AM
Simple, and great - really handy if you want to make a simple default style for people who havent registered without overwriting files - Installs

Dean C
03-21-2003, 02:32 PM
Awesome - i look forward to it loo :)

- miSt

AnaFreak
03-22-2003, 10:17 AM
thanks very nice work, came in handy

SavgeDusk
03-23-2003, 05:56 PM
Great hack. This will definitely be very useful.

Mr. X
04-04-2003, 06:06 AM
Stupid question, but how do you know what styleid a style is? I assume default is 1? I have 3 styles btw.

SmartGnome
04-07-2003, 01:51 PM
Very usefull hack. I missed the function in VB :D

Thanks :banana Install clicked

Oblivion Knight
04-16-2003, 07:26 PM
Another hack that Jelsoft should add with the original package.. ;)
Installed with no problems at all on 2.3.0 RC3, loving it.!

You may want to fix that typo in the db query though.. You've missed the f on "default" and unless fixed, shows in the cp as "deault".

* Oblivion Knight clicks install.

blackice912
04-17-2003, 05:19 AM
Woohoo, I've needed this for SO long. You rule :)

FFArmageddon
04-24-2003, 11:39 PM
*is destin from VBT)

thanks alot :) This saved my board

btw this runs fine on 2.2.6 :)


*installs

FFArmageddon
04-25-2003, 01:17 PM
uhm hey I am having a problem with this :\

It changed tbe default style fine for members who are logged in. But if you are a guest or logged out, only the forum main page style changes.

Could it have something to do with the issues I mentioned on vbt?

Michael Foster
04-25-2003, 03:13 PM
Thanks, I currently have 6 styles on my forum and plan on eventually adding more. This will be very useful. :D

Brad
04-25-2003, 05:14 PM
Today at 10:17 AM FFArmageddon said this in Post #19 (https://vborg.vbsupport.ru/showthread.php?postid=386950#post386950)
uhm hey I am having a problem with this :\

It changed tbe default style fine for members who are logged in. But if you are a guest or logged out, only the forum main page style changes.

Could it have something to do with the issues I mentioned on vbt?

Im not sure what could be doing that.

You might want to think about opening a support ticket (http://vbulletin.com/members/support_form.php).

FFArmageddon
04-25-2003, 08:16 PM
Ok I think I will do just that :)

thanks

Jujimufu
04-27-2003, 12:46 AM
This isn't working for me. I installed it and no errors, but it doesn't do anything. I have 2 styles. One called default and one called Empire I created. So that's 2 including the one that came with the forum. I tried setting style ID to 1-2-3-4-5-6.dsfpiaq3poias-e0fm alot of them lol! And nothing ever happens as should. I expected for when a new visitor who visits the board will have the style set as Empire not default. And... it doesn't I don't understand lol! Sorry, maybe it's obvious but it's definately not harming me, or working at that either.

mx3
04-27-2003, 02:19 AM
w00t!!! i've needed this for sooo long! *installs!*

works fine!

TheEnd
04-27-2003, 06:42 AM
How do I tell what the style ID is? I got like 3 styles, wheres it say which is which?

Brad
04-27-2003, 03:19 PM
How to find styleid's.


This adds the current style id of a style to the modifiy styles page of the admin cp, makes it easyer on newbies who dont know how to find style id's ;)

To upgrade:

In /admin/style.php find:

// ###################### Start Modify #######################
if ($action=="modify") {

doformheader("","");
maketableheader("Style Sets");
$styles=$DB_site->query("SELECT styleid,title FROM style ORDER BY title");
while ($style=$DB_site->fetch_array($styles)) {

echo "<tr class='".getrowbg()."'>\n<td><p>$style[title]</p></td><td><p>".
makelinkcode("fonts/colors/etc","style.php?s=$session[sessionhash]&action=styles&dostyleid=$style[styleid]").
makelinkcode("properties","style.php?s=$session[sessionhash]&action=edit&editstyleid=$style[styleid]",0,"edit style properties").
makelinkcode("download","style.php?s=$session[sessionhash]&action=dodownload&styleid=$style[styleid]").
iif($style[styleid]!=1,makelinkcode("remove","style.php?s=$session[sessionhash]&action=remove&styleid=$style[styleid]"),"").
"</p></td></tr>\n";

}

echo "</table></td></tr></table>";

}

Replace by:

// ###################### Start Modify #######################
if ($action=="modify") {

doformheader("","");
maketableheader("Style Sets");
$styles=$DB_site->query("SELECT styleid,title FROM style ORDER BY title");
while ($style=$DB_site->fetch_array($styles)) {

echo "<tr class='".getrowbg()."'>\n<td><p>$style[title] (style id $style[styleid])</p></td><td><p>".
makelinkcode("fonts/colors/etc","style.php?s=$session[sessionhash]&action=styles&dostyleid=$style[styleid]").
makelinkcode("properties","style.php?s=$session[sessionhash]&action=edit&editstyleid=$style[styleid]",0,"edit style properties").
makelinkcode("download","style.php?s=$session[sessionhash]&action=dodownload&styleid=$style[styleid]").
iif($style[styleid]!=1,makelinkcode("remove","style.php?s=$session[sessionhash]&action=remove&styleid=$style[styleid]"),"").
"</p></td></tr>\n";

}

echo "</table></td></tr></table>";

}

Thats it!

BoardTyrant
05-01-2003, 01:24 PM
How do you run an SQL Query or rather where do I run the needed SQL query :

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,2,'Default style set.','loo_default_style','1','Set this number to the style id you wish to be displayed by deault (note: This will not overwrite style settings in user profiles!)','','7');

Also, how do I view the global.php file and edit it?

Brad
05-01-2003, 04:03 PM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=39142" target="_blank">https://vborg.vbsupport.ru/showt...threadid=39142</a>

BoardTyrant
05-01-2003, 04:58 PM
Thanks I hope I can figure it out

gwhooooey
05-03-2003, 10:18 PM
04-25-03 at 03:17 PM FFArmageddon said this in Post #19 (https://vborg.vbsupport.ru/showthread.php?postid=386950#post386950)
uhm hey I am having a problem with this :\

It changed tbe default style fine for members who are logged in. But if you are a guest or logged out, only the forum main page style changes.

Could it have something to do with the issues I mentioned on vbt?

Same problem here

msimplay
05-03-2003, 10:23 PM
wicked hack but it makes u wonder why such a hack isn;t there by default :p

KonZu
05-03-2003, 11:55 PM
working fine (2.3.0) , very usefull hack

thx
yrs KonZu

Bahawolf2
05-11-2003, 07:46 PM
05-04-03 at 12:18 AM gwhooooey said this in Post #30 (https://vborg.vbsupport.ru/showthread.php?postid=390993#post390993)
Same problem here
Yup, same.

gmarik
05-24-2003, 08:24 AM
If you would also make a cp.css reader, it would be something!
Like on phpBB, they have something like that.

gwhooooey
05-25-2003, 01:29 AM
INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,2,'Default style set.','loo_default_style','1','Set this number to the style id you wish to be displayed by deault (note: This will not overwrite style settings in user profiles!)','','7');

How do I reverse this? I'm removing the hack. Thanks

Austin Dea
05-27-2003, 01:01 AM
This only changes the style for index.php only. If I click a forum, it's back to the default(id=1) style.

Danielo
07-31-2003, 04:38 PM
yes...
it doesn't function verywell!!

i have the same problem of Austin Dea!!

Let's check it

If an anonymous user enter the forum, the board shows perfectly th index.php paage, but the other are wrong

StrykerContact
08-27-2003, 01:34 AM
Thanks, just what I needed.

StrykerContact
08-27-2003, 01:51 AM
Ok this hack doesn't work right, it only sets my index.php as the style I set default to, but when I click a forum section it changes back to the real default.

DraX
09-01-2003, 05:34 PM
You guys are forgetting that each forum has it's own styleid. If set not to override user defaults, it will still be used whenever a guest is logged in. You'll have to change those forums to whatever your forum default is if you want it to function in there.

I've written a quick alternative to this.....

make these changes in admin/forum.php:

find// ###################### Start add #######################replace with// ################## Start defaultstyle ###################
if ($HTTP_POST_VARS['action']=="defaultstyle") {
if ($defaultstyle=="" AND $loo_default_style=="") {
echo "<b>YOU DO NOT HAVE A RECOGNIZED DEFAULT STYLE HACK INSTALLED!<BR>
You need to have installed Avalon Site Manager or
<a href=\"https://vborg.vbsupport.ru/showthread.php?s=&threadid=50491\">
Anime-Loo's Default Style Hack</a> in order to change the default style of
all of your site's forums to the default set by those hacks/add-ons.<br><br>";
} else {
$newstyle=$loo_default_style;
//Since Avalon Site Manager includes a default style changer for both the forums and the site content,
//we need to override Anime-Loo's hack if installed to preserve ASM's functionality.
//Sorry, Anime-Loo.
if ($defaultstyle!="") {
$newstyle=$defaultstyle;
}
$DB_site->query("UPDATE forum SET styleid='$newstyle' WHERE styleoverride='0'");
echo "Default Forum Styles changed to $newstyle!<br><br>";
}
}

// ###################### Start add #######################
find echo "<p>If you change the orders, please be sure to submit the form using the buttons at the bottom of the page</p>";replace with if ($defaultstyle OR $loo_default_style) {
doformheader("forum","defaultstyle");
maketableheader("Default Style Modification Detected!");
makedescription("You have installed either Avalon Site Manager or
<a href=\"https://vborg.vbsupport.ru/showthread.php?s=&threadid=50491\">Anime-Loo's Default Style Hack</a>.<br>
Would you like to change all forums here that do not override a user's selected style to the forum default?");
doformfooter("Yes, Fix the Default Style of my Forums","");
}

echo "<p>If you change the orders, please be sure to submit the form using the buttons at the bottom of the page</p>";

This should solve all your troubles if you use this everytime you change your default style.

StrykerContact
09-02-2003, 04:55 AM
Just remake the damn hack and give the origional creater credit.

DraX
09-02-2003, 05:39 AM
Whoa! No reason for the hostility, guy.

I put this together quick for those of you who were having trouble with it. Which may have been good anyway, since my personal project, Avalon Site Manager, had similar functionality and I had not yet considered at the time that the forums needed their styleid's changed as well.

Anyway, I've contacted anime-Loo and given her permission to bundle this within the original hack if she liked. The functionality of the basic portion of her code was quite simple however, and given a lack of response I may do just what you suggested.

Zachery
09-02-2003, 11:21 AM
upgrading to vb3 line by line, its default in vb3 :) looks nice but i dont run any vb2 forums anymore

Brad
09-03-2003, 11:12 PM
Yesterday at 02:39 AM DraX said this in Post #42 (https://vborg.vbsupport.ru/showthread.php?postid=430622#post430622)
Whoa! No reason for the hostility, guy.

I put this together quick for those of you who were having trouble with it. Which may have been good anyway, since my personal project, Avalon Site Manager, had similar functionality and I had not yet considered at the time that the forums needed their styleid's changed as well.

Anyway, I've contacted anime-Loo and given her permission to bundle this within the original hack if she liked. The functionality of the basic portion of her code was quite simple however, and given a lack of response I may do just what you suggested.

He ;).

Ive been planing a update for awhile (alot of my hacks need them). Im not sure if I am going to bundle your code or not at this point. But thanks for the quick fix for the current version ;)

Big J
09-13-2003, 03:57 PM
Drax - THANKS FOR THE FIX!!!!!!!

Red Blaze
11-13-2003, 03:45 PM
Exactly what I was looking for. :D

Will try to install now. :)

EDIT: Works like a charm! Thanks alot! Just a little something that could be helpfull, can it become like a drop down menu listing the styles? Dunno if it could be possible, if so, that'd be great. Either way it's good.

* Red Blaze click install