Announcement

Collapse
No announcement yet.

[release] vb 2.0b1 : View templates inline

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [release] vb 2.0b1 : View templates inline

    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:
    Last edited by dwh; Sat 30 Jun '01, 12:12pm.

  • #2
    Suggestion: run it through the replacement variables before displaying.

    Comment


    • #3
      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...

      Comment


      • #4
        check how templates are normally parsed, it should be there somewhere.
        - Insert viable disclaimer here -

        ArtBeast!

        Comment


        • #5
          A quick look in misc.php should give you the answers you seek.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API - Full / Mobile
          Vote for your favorite feature requests and the bugs you want to see fixed.

          Comment


          • #6
            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]
            Last edited by dwh; Wed 21 Feb '01, 1:39am.

            Comment


            • #7
              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.

              Comment


              • #8
                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?

                Comment


                • #9
                  Nice help, especially while translating Thx...

                  But you shoukld prevent one thing:

                  Ever tried to edit standardredirect ????

                  Comment


                  • #10
                    Originally posted by Sven
                    Nice help, especially while translating Thx...

                    But you shoukld prevent one thing:

                    Ever tried to edit standardredirect ????
                    heh heh, no idea how to help this but I see your point

                    Comment


                    • #11
                      plez help

                      for Version RC1
                      NOT WERKIN

                      Comment


                      • #12
                        plez help

                        Comment


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

                          Comment


                          • #14
                            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]")."\");");

                            Comment


                            • #15
                              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.

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X