vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Preview Style Hack [vB3] (https://vborg.vbsupport.ru/showthread.php?t=61032)

assassingod 01-31-2004 10:00 PM

Preview Style Hack [vB3]
 
Style Preview Hack

Coded by: assassingod

Description:
This gives your users an easier and more imformative way of changing styles.
It gives changing styles it's own page in the UserCP, which includes a
preview of the styles and a description. These can also be edited in the
Edit Settings for styles in the AdminCP

MindTrix 02-01-2004 08:54 AM

2 hacks in one day :) **wonders if you will release more**

Nice one mate and thanks

colicab-d 02-01-2004 09:27 AM

ooh now i,ll deff be using this one :D ... why did no one think of this sooner lol

FleaBag 02-01-2004 09:37 AM

I've said it before and I'll say it again... You are the man. :D

Zachery 02-01-2004 10:23 AM

Nice steve as always :)

Allan 02-01-2004 10:37 AM

after 2 install, it is similar, I have some problem with this hack, here:

- the following line in the template "USERCP_SHELL" do not exist

PHP Code:

<tr>
    <
td class="$navclass[options]style="white-space:nowrap"><class="smallfont" href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td>
</
tr

- another thing, the title "description" of does not fit in the configuration of the styles (see screen1)

- a last thing also, in the control panel "Edit Style" is not posted either (see screen2)

Dean C 02-01-2004 10:46 AM

vB3 uploads are dead easy to work with - might be nice to offer the ability to update the code.

gmarik 02-01-2004 10:54 AM

This is good - you could only add a two column mode as well ... to be more compact ..

Dan 02-01-2004 11:25 AM

nice one :D I might use this after i get more styles finished

TheComputerGuy 02-01-2004 12:18 PM

Awesome hack man! Great job!

assassingod 02-01-2004 02:06 PM

Sorry all, I forgot to mention some Phrases to be added.
All who use this hack, add these phrases:
Code:

Type: Control Panel Global
Varname: styledescription
Text: Description

and
Code:

Type: Global
Varname: edit_style
Text: Edit Style

That should be it. Thanks all for the feedback too.

Socrate;
I'm not sure why the code isn't appearing for you - it's there on my version, RC3.

Mist;
Eh?

gmarik;
Could you explain more?

assassingod 02-01-2004 02:24 PM

Just updated the txt file (updated to 1.1), all who download before now re-download.

Allan 02-01-2004 05:16 PM

Quote:

Originally Posted by assassingod
Socrate;
I'm not sure why the code isn't appearing for you - it's there on my version, RC3.

I does not include/understand why this line is not in my version RC3

but it is not serious, I have to adapt assassingod ;)

On the other hand, the changes in the template should not be make in EACH template to be taken into account by the hack ?

but I hold has to say you cheer for this superb hack, I appreciate :)

MGM 02-02-2004 01:27 AM

nice one assassingod! ill definetily install this one!

/me clicks install

MGM out

Dean C 02-02-2004 08:22 AM

I mean instead of offering a url to the image offer the ability to upload it directly to a specified folder (in options) or into the database :)

Boofo 02-02-2004 09:20 AM

Steve. I'm getting red 'x where the styles should preview in the user cp. I made the image/styles directory that you said to, by the way. Also, the vertical link bar is not showing the right alt colors when you see the edit styles link and after you click on the link, that whole menu turns a solid alt color.

Boofo 02-02-2004 10:35 AM

Ok, I got it partially figured out. You might want to add to to your instructions for dummies like me that you have to take a snapshot of your styles and upload them to the newly created styles directory. ;)

Also, where do I add the navclass[styles] colors or get them to display right in the menu on the left?

assassingod 02-02-2004 01:02 PM

Boofo;
I'm glad you sorted some out, and i'll make the instructions clearer;)
I think I forgot to mention some more file edits so i'll investigate that

Mist;
Nice idea, i'll think about it

Socrate;
Quote:

On the other hand, the changes in the template should not be make in EACH template to be taken into account by the hack ?
What do you mean?

Thanks all who like this hack.

Boofo 02-02-2004 01:09 PM

Also, Steve, when I go into the Edit Styles area, the bottom style is always checked even though the top style is the one I picked. Shouldn't the radio button be on the style that you have set for yourself?
What file would this be in?

navclass

sabret00the 02-02-2004 01:24 PM

Quote:

Originally Posted by Mist
I mean instead of offering a url to the image offer the ability to upload it directly to a specified folder (in options) or into the database :)

great idea, although already a great hack, thank you very much :)

Boofo 02-03-2004 10:01 AM

Steve, any fix for this yet?

Allan 02-03-2004 05:51 PM

Quote:

Originally Posted by assassingod
Socrate;

What do you mean?

if one does not modify all the templates, for then modifying the style, one is obliged to reconsider the style or the template was to modify, it is a pity ..

Boofo 02-05-2004 09:21 AM

Steve, I'm going to uninstall this since it seems there isn't going to be a fix for it very soon. Sorry.

PheReFuLL 03-05-2004 12:20 AM

I like the hack, but the only thing I can seem to figure out is how to change the color of the area that says "Edit Styles" when you go to your UserCP. The color is incorrect. >>

Can anyone help?

Boofo 03-05-2004 12:59 AM

I hope you get a fix for that but I wouldn't hold my breath on it. I never got the fix and uninstalled it for that reason. ;)

PheReFuLL 03-05-2004 01:13 AM

Well, it's not worth uninstalling it for a simple color problem. I'm sure, if I look hard enough, I can figure out the problem myself. I just figured he would be more aware of the coding and whatnot. >>

Boofo 03-05-2004 01:16 AM

It wasn't just the color problem as to why I uninstalled it. If you check one of the radio buttons and then exit that area and go back in, the first radio button is always checked. That was never fixed either, IIIRC.

PheReFuLL 03-05-2004 06:29 PM

When I go back, none of the styles are selected. I'm not going to bother uninstalling it for something as little as that, either. It's a good hack and helpful.

Boofo 03-05-2004 08:01 PM

If it works like you want it to, then that is all that counts. ;)

sabret00the 04-01-2004 08:55 AM

unreasonable resquest/idea but i know theirs some scritps that can make a screenshot of a page, if something like that could be incorperated that'd be awesome :)

[high]* sabret00the goes back to being lazy[/high]

fridayweb 05-01-2004 05:07 PM

OK, I found one fix -

In profile.php

Find:
Code:

$templatename = 'modifystyle';
Replace with:
Code:

// draw cp nav bar
        construct_usercp_nav('style');
        $navbits[''] = $vbphrase['edit_style'];
        $templatename = 'modifystyle';

That will make the colors appear correctly when you are in the actual style preview page.


I was having problems getting the code to work correctly to fix the color on the usercp, so here is a sloppy patch until it actually gets fixed.

In USERCP_SHELL

Find:
Code:

<tr>
        <td class="$navclass[style]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editstyle">$vbphrase[edit_style]</a></td>
</tr>

Replace with:
Code:

<tr bgcolor="#222222">
        <td class="$navclass[style]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editstyle">$vbphrase[edit_style]</a></td>
</tr>

I just entered the color I wanted, and it worked. I hope someone can fix this hack so that the right variable gets shown... :disappointed:

MGM 07-05-2004 07:39 PM

thanks for that fix man, helped me out a lot

MGM out

|Jordan| 02-04-2006 01:14 AM

Actually, here's a easier way to fix the color and it's the same code for all styles (should work for them all, it did for me and i have 8 styles on my forum):

Replace:
Code:

<tr>
        <td class="$navclass[style]" style="white-space:nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editstyle">$vbphrase[edit_style]</a></td>
</tr>

With this:
Code:

<tr class="alt2">
        <td class="$navclass[style]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editstyle">$vbphrase[edit_style]</a></td>
</tr>

Also add the following code to precache the templates:

Find
Code:

'editoptions' => array(
                'modifyoptions',
                'modifyoptions_timezone',
                'userfield_checkbox_option',
                'userfield_optional_input',
                'userfield_radio',
                'userfield_radio_option',
                'userfield_select',
                'userfield_select_option',
                'userfield_select_multiple',
                'userfield_textarea',
                'userfield_textbox',
        ),

Add After
Code:

'editstyle' => array(
                'modifystyle',
                'modifystylebit'
        ),



All times are GMT. The time now is 04:50 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.01234 seconds
  • Memory Usage 1,805KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (33)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