vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vb 2.0b1 : View templates inline (https://vborg.vbsupport.ru/showthread.php?t=9131)

dwh 02-18-2001 10:00 PM

Updated 06/30/01 for v2.01 plus added feature for Preview of "View Original"

To make it easier to see what a template looks like, Set up a Preview by following these instructions:

1. Open template.php.
2. Look for (around line 79)
Code:

  makeinputcode("Template name","title",$title);
  makechoosercode("Template set","templatesetid","templateset",iif(isset($templatesetid),$templatesetid,-1),iif($debug,"All - global to all template sets",""));
  maketextareacode("Template<br><br><font size='1'>".iif(isset($title),makelinkcode("view default template","template.php?s=$session[sessionhash]&action=view&title=$title",1)."</font>",""),"template",$template,25,80);
  makehiddencode("group", "$group");
  doformfooter("Save");

3. DIRECTLY After that add
Code:

echo "<b>Preview Code Placement:</b><hr>$template<hr><b>Preview Page Layout:</b><hr>\n";
  eval("dooutput(\"".gettemplate("$title")."\");");

4.Look for (around line 99)
Code:

  makeinputcode("Template name","title",$template[title]);
  makechoosercode("Template set","templatesetid","templateset",$template[templatesetid],iif($debug,"All - global to all template sets",""));
  maketextareacode("Template<br><br><font size='1'>".makelinkcode("view default template","template.php?s=$session[sessionhash]&action=view&title=$template[title]",1)."</font>","template",$template[template],25,80);
  makehiddencode("group", "$group");
  doformfooter("Save Changes");

5. DIRECTLY After that add
Code:

  $templatesetid=$template[templatesetid];
  echo "<b>Preview Code Placement:</b><hr>$template[template]<hr><b>Preview Page Layout:</b><hr>\n";
  eval("dooutput(\"".gettemplate("$template[title]")."\");");

6. Look for (around line 125)
Code:

  doformheader("","");
  maketableheader("View Default template");
  maketextareacode($template[title],"",$template[template],20,80);
  echo "</table>\n</td></tr></table></form>";

7. DIRECTLY After that add
Code:

  echo "<b>Preview Code Placement:</b><hr>$template[template]<hr><b>Preview Page Layout:</b><hr>\n";
  eval("dooutput(\"".gettemplate("$title")."\");");

Screenshot below:

02-19-2001 05:10 AM

Suggestion: run it through the replacement variables before displaying.

02-19-2001 05:20 AM

Sounds like a great idea, but I have no idea how to do that...not familiar enuf w/ the code...but if u give me a clue or 2 I'll work on it...

02-19-2001 01:41 PM

check how templates are normally parsed, it should be there somewhere.

02-19-2001 02:34 PM

A quick look in misc.php should give you the answers you seek.

02-21-2001 08:36 AM

OK, now that I put it through templates, sometimes it looks a bit funny. So I output it both ways.

Since you actually need these variables to make it look good, this hack is not for everyone, but I find it very useful when working on the templates.

I've updated the hack instructions above...[thanks to menno and wluke]

02-22-2001 12:51 PM

You need to change point 5 to
Code:

$templatesetid=$template[templatesetid];
echo "<hr>$template[template]<hr>\n";
eval("dooutput(\"".gettemplate("$template[title]")."\");");

Otherwise gettemplate will always get the default template and not the one you are going to edit.

02-22-2001 04:41 PM

Quote:

Originally posted by Fryzid
You need to change point 5 to
Code:

$templatesetid=$template[templatesetid];
echo "<hr>$template[template]<hr>\n";
eval("dooutput(\"".gettemplate("$template[title]")."\");");

Otherwise gettemplate will always get the default template and not the one you are going to edit.

Thanks, I'll try that, maybe that's why it was coming out weird. But I'm wondering how
Code:

$templatesetid=$template[templatesetid]
can change the value of
Code:

eval("dooutput(\"".gettemplate("$template[title]")."\");")
later?

02-23-2001 08:38 PM

Nice help, especially while translating ;) Thx...

But you shoukld prevent one thing:

Ever tried to edit standardredirect ???? :D

02-24-2001 12:00 AM

Quote:

Originally posted by Sven
Nice help, especially while translating ;) Thx...

But you shoukld prevent one thing:

Ever tried to edit standardredirect ???? :D

heh heh, no idea how to help this but I see your point :)

bokhalifa 04-19-2001 04:18 AM

plez help

for Version RC1
NOT WERKIN:confused:

bokhalifa 04-19-2001 09:00 PM

plez help
https://vborg.vbsupport.ru/

dwh 06-27-2001 04:22 PM

Just saw this. Haven't installed this on vb2.0gold....Sorry, but if I ever do I'll see if I can help.

lichtflits 06-27-2001 05:59 PM

This code works to for version 2.0.1

find in admin/templates.php:
PHP Code:

  makeinputcode("Template name","title",$title);
  
makechoosercode("Template set","templatesetid","templateset",iif(isset($templatesetid),$templatesetid,-1),iif($debug,"All - global to all template sets",""));
  
maketextareacode("Template<br><br><font size='1'>".iif(isset($title),makelinkcode("view default template","template.php?s=$session[sessionhash]&action=view&title=$title",1)."</font>",""),"template",$template,25,80);
  
makehiddencode("group""$group");
  
doformfooter("Save"); 

DIRECTLY After that add:
Code:

    echo "<hr>$template<hr>\n";
  eval("dooutput(\"".gettemplate("$title")."\");");


find:
PHP Code:

  makeinputcode("Template name","title",$template[title]);
  
makechoosercode("Template set","templatesetid","templateset",$template[templatesetid],iif($debug,"All - global to all template sets",""));
  
maketextareacode("Template<br><br><font size='1'>".makelinkcode("view default template","template.php?s=$session[sessionhash]&action=view&title=$template[title]",1)."</font>","template",$template[template],25,80);
  
makehiddencode("group""$group");
  
doformfooter("Save Changes"); 

DIRECTLY After that add:
Code:

  echo "<hr>$template[template]<hr>\n";
  eval("dooutput(\"".gettemplate("$template[title]")."\");");


dwh 06-27-2001 06:14 PM

I haven't look at this code since February, so I'm not sure, are you giving changed code for 2.01 or are you simply adding some lines that are needed for 2.01. Because I'll be happy to modify the original instructions if needed.

JenniferS 06-28-2001 03:44 AM

i worked with a forum system a while back that kept all its language in one file, which made it very easy to translate and "rephrase" the board. editing one language file would be much easier than the mouse click marathon i recently undertook in the admin control panel when editing the error/redirect messages for my board.

Prezident 06-28-2001 07:23 PM

This looks like a pretty handy little hack. I might have to try it out.

Would it be possible to get the all the instructions of this hack put into 1 post or txt file so that I am sure I have all the information together at the same time when I try to install this?

I would really like to try this one out. It looks very handy.

Prezident 06-30-2001 01:02 PM

Please post the modified full instructions for this hack. I would really like to be able to try it out.

Also, I am running version 2.0 right now rather then 2.0.1. Do you see any problems with that?

dwh 06-30-2001 02:53 PM

I started looking at the code to try and update this hack but none of the code looks familiar at all, maybe they changed the way things work or my memory really fails me...I'll look into it some more though...maybe install the other template hack which was quite good I think, it may jog my memory..

webhost 06-30-2001 05:42 PM

I tried the second hack on this topic, It didn't work at all, I am using 2.0.1, it showed some templates and some it just showed a box with edit template in the left hand corner. I copied in pasted it from the hack right into place in the template.php file under the admin directory. I tried to edit templates from CP after I installed it. I took it back out until someone maybe can answer what is going on?

Any ideas?

Joeey

dwh 06-30-2001 05:56 PM

I updated the instructions and got this to work well on my system. Try it out now. Please report back any problems. One note, the reason it is displaying two previews is that the first preview shows you variables like so $variable which will give you an idea of placement, and the second time it evaluates the $variables and outputs the result. Sometimes both outputs will look identical but this makes the whole template editing process much easier, at least imo.

Moderator, can you change the subject line to reflect that this now works for 2.01 (assuming no one complains of problems)? Thanks.

Prezident 06-30-2001 11:48 PM

Does this mean that it won't work with version 2.0.0?

Argh, not ready to upgrade to that yet. From what I understand I will have to reinstall all of my hacks then.

dwh 07-01-2001 04:01 AM

I never got access to v 2.0 so I don't know for sure, but It probably will work fine. What I'd do is check if the code looks different on those lines where it says "look for" and if it does, you'll be fine, if not, post the difference here and I'll see if I can help w/ some modified code...

webhost 07-01-2001 04:49 AM

still got a problem. I made changes and template area in vb control panel looks the same as it always did except now I don't have a save button.

Add new template
Template name


Template set
bbman Default

Template

[view default template]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>AIM Message</title>
$headinclude
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#ffff

Joey
Let Me know when you have a fix.
if you want I could email you my template.php file

dwh 07-02-2001 01:59 AM

Hi,
I've looked at it and did a compare to my file and it was identical other than whitespace!! I'm baffled.... I know this is a stupid question and all, but you did upload it as ascii? Also, what platform are you running? Maybe it's that?

webhost 07-02-2001 03:34 AM

yes and redhat linux verson 7.1

dwh 07-02-2001 03:42 PM

Very strange...yup I'm on linux too. No idea what it could be..

webhost 07-02-2001 03:57 PM

post your template file and I will download and take a look.

Joey

dwh 07-30-2001 11:38 PM

Quote:

Originally posted by webhost
post your template file and I will download and take a look.

Joey

It's identical to mine. BTW, we're not really supposed to be uploading any code. I'm surprised the moderators didn't remove it.

Freddie Bingham 07-30-2001 11:42 PM

And don't do it again :)


All times are GMT. The time now is 10:16 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.01695 seconds
  • Memory Usage 1,815KB
  • 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
  • (12)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (30)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