Results 1 to 15 of 30
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: [release] vb 2.0b1 : View templates inline

  1. #1
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229

    [release] vb2.01 View Preview of 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 30th Jun '01 at 5:12pm.
     

  2. #2
    Former vBulletin Developer Mike Sullivan will become famous soon enough Mike Sullivan's Avatar
    Join Date
    Apr 2000
    Location
    Regexia
    Age
    25
    Posts
    13,374
    Blog Entries
    7
    Suggestion: run it through the replacement variables before displaying.
    --Mike "Ed" Sullivan
    Former vBulletin Developer

    Twitter | Regexia (personal)
     

  3. #3
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    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...
     

  4. #4
    Senior Member Menno is on a distinguished road Menno's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Age
    25
    Posts
    1,226
    check how templates are normally parsed, it should be there somewhere.
    - Insert viable disclaimer here -

    ArtBeast!
     

  5. #5
    vBulletin Team Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke's Avatar
    Join Date
    Aug 2000
    Location
    So. California
    Age
    38
    Posts
    34,676
    Blog Entries
    1
    A quick look in misc.php should give you the answers you seek.
    Wayne Luke
    Get started with your own social network.
    Purchase and download vBulletin today.
    vBCodex (Running vB 4.0 Suite) - Take your vBulletin Community to the next level. Modification tips, tricks and support.
     

  6. #6
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    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 21st Feb '01 at 6:39am.
     

  7. #7
    Senior Member Fryzid is on a distinguished road Fryzid's Avatar
    Join Date
    Jun 2000
    Location
    im Garten
    Posts
    164
    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.
     

  8. #8
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    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?
     

  9. #9
    Senior Member Sven has disabled reputation Sven's Avatar
    Join Date
    Dec 2000
    Location
    Germany
    Age
    42
    Posts
    240
    Nice help, especially while translating Thx...

    But you shoukld prevent one thing:

    Ever tried to edit standardredirect ????
     

  10. #10
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    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
     

  11. #11
    Member bokhalifa is on a distinguished road bokhalifa's Avatar
    Join Date
    Feb 2001
    Location
    u a e dubai
    Age
    33
    Posts
    99
    plez help

    for Version RC1
    NOT WERKIN
    In Dubai every thing is different
     

  12. #12
    Member bokhalifa is on a distinguished road bokhalifa's Avatar
    Join Date
    Feb 2001
    Location
    u a e dubai
    Age
    33
    Posts
    99
    plez help
    In Dubai every thing is different
     

  13. #13
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    Just saw this. Haven't installed this on vb2.0gold....Sorry, but if I ever do I'll see if I can help.
     

  14. #14
    Member lichtflits is on a distinguished road lichtflits's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Age
    25
    Posts
    50
    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]")."\");");
     

  15. #15
    Senior Member dwh is on a distinguished road dwh's Avatar
    Join Date
    Sep 2000
    Location
    **** test
    Posts
    1,229
    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.
     

Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. Can not view inline images
    By rick in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 5
    Last Post: Mon 7th Jun '04, 10:20pm
  2. Inline or Thumbnail view of attachments....
    By deffy in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 2
    Last Post: Tue 20th Apr '04, 5:57pm
  3. Replies: 6
    Last Post: Wed 1st Aug '01, 3:33pm
  4. [Pretend Release v2.0] Inline <pre> text
    By tubedogg in forum vBulletin Templates, Graphics & Styles
    Replies: 0
    Last Post: Fri 4th May '01, 5:02am

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts