Wierd Template Error that only occurs when not logged in Wierd Template Error that only occurs when not logged in
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Wierd Template Error that only occurs when not logged in

Started by just_some_guy, November 21, 2007, 10:28:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

just_some_guy

Hey,

I was customizing the ipodlounge theme today; which involved making the navigation vertical and aligned to the left, i used the code from DaMysterious final fantasy theme to achieve this. All was going well until i logged out of my gallery and received this error - i have a hunch it is to do with the Modpack by Stramm. The error is -


Template error
Failed to find block 'my_friends'(#(<!-- BEGIN my_friends -->)(.*?)(<!-- END my_friends -->)#s) in :

                <span class="topmenu">

<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a><br /><br />
<!-- END my_gallery -->

<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a><br /><br />
<!-- END allow_memberlist -->



<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a><br /><br />
<!-- END faq -->





<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a><br /><br />
<!-- END upload_pic -->

<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a><br /><br />
<!-- END register -->

<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}" title="">{LOGIN_LNK}</a>
<!-- END login -->


</span>


And here is the code from theme.php -


<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.3
  $Source: /cvsroot/coppermine/stable/themes/sample/theme.php,v $
  $Revision: 1.4 $
  $Author: donnoman $
  $Date: 2005/12/04 03:22:35 $
**********************************************/

define('THEME_HAS_NAVBAR_GRAPHICS'1);

// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48px"><a name="top_display_media"></a>
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="{LOCATION}images/up.gif" align="middle" border="0px" alt="{THUMB_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0px" align="middle" alt="{PIC_INFO_TITLE}" /></a>
                </td>

                                <td align="center" valign="middle" class="navmenu" width="48px">
                                                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="{LOCATION}images/prev.gif"  border="0px" align="middle" alt="{PREV_TITLE}" /></a>
                </td>





                <td align="center" valign="middle" class="navmenu" width="100%">
                        {PIC_POS}
                </td>


                                <td align="center" valign="middle" class="navmenu" width="48px">
                                                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="{LOCATION}images/next.gif"  border="0px" align="middle" alt="{NEXT_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{SLIDESHOW_TGT}" class="navmenu_pic" title="{SLIDESHOW_TITLE}"><img src="{LOCATION}images/slideshow.gif" border="0px" align="middle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}"><img src="{LOCATION}images/report.gif" border="0" align="middle" alt="{REPORT_TITLE}" /></a>
                </td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}"><img src="{LOCATION}images/ecard.gif"  border="0px" align="middle" alt="{ECARD_TITLE}" /></a>
                </td>
<!-- END ecard_button -->


        </tr>

EOT;
//define('THEME_IS_XHTML10_TRANSITIONAL',1);

// HTML template for main menu
$template_sys_menu = <<<EOT
                <span class="topmenu">

<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a><br /><br />
<!-- END my_gallery -->

<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a><br /><br />
<!-- END allow_memberlist -->

<!-- BEGIN my_profile -->
                        <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a><br /><br />
<!-- END my_profile -->

<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a><br /><br />
<!-- END faq -->

<!-- BEGIN enter_admin_mode -->
                        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a><br /><br />
<!-- END enter_admin_mode -->

<!-- BEGIN leave_admin_mode -->
                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a><br /><br />
<!-- END leave_admin_mode -->

<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a><br /><br />
<!-- END upload_pic -->

<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a><br /><br />
<!-- END register -->

<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}" title="">{LOGIN_LNK}</a>
<!-- END login -->

<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}" title="">{LOGOUT_LNK}</a><br />
<!-- END logout -->
</span>
EOT;

// HTML template for sub_menu
$template_sub_menu = <<<EOT

<!-- BEGIN custom_link -->
     <a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a><br /><br />
<!-- END custom_link -->

<!-- BEGIN album_list -->
     <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a><br /><br />
<!-- END album_list -->
<a href="{LASTUP_TGT}">{LASTUP_LNK}</a><br /><br />
<a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a><br /><br />
<a href="{TOPN_TGT}">{TOPN_LNK}</a><br /><br />
<a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a><br /><br />
<a href="{FAV_TGT}">{FAV_LNK}</a><br /><br />
<a href="{SEARCH_TGT}">{SEARCH_LNK}</a>

EOT;

?>


and template.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/ipodlounge/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
{CUSTOM_HEADER}
<!-- SPACER - START -->
<img src="themes/ipodlounge/images/_spacer_blank.gif" width="1" height="8" alt="" border="0"><br /><!-- SPACER - END -->
<table border=0 cellpadding=0 cellspacing=0 width="800" align="center">
<tr>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/white_corner_topleft.gif" width=7 height=7 alt="" border=0></td>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/_spacer_blank.gif" width=735 height=7 alt="" border=0></td>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/white_corner_topright.gif" width=7 height=7 alt="" border=0></td>
</tr>
</table>

<table bgcolor="#FFFFFF" border=0 cellpadding=0 width="800" cellspacing=0 align="center">
<tr>
<td bgcolor="#FFFFFF" class="bodytext" align="center">
<br />
<img src="themes/ipodlounge/images/logo.jpg" border=0>
</td>
</tr>
</table>
<table border=0 cellpadding=25 cellspacing=0 width="800" align="center">
<tr>
<td bgcolor="#FFFFFF" >
<div id="links" style="z-index: 1; position: absolute; top: 200; left: 0;">
<p class="topmenu" align="left">
<strong>Navigation</strong><br />
{SYS_MENU} </br> {SUB_MENU}
</div>



<div class="nav">
  {ADMIN_MENU}
</div>
{GALLERY}
</td>
</tr>
</table>


<table border=0 cellpadding=0 cellspacing=0 width="800" align="center">
<tr>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/white_corner_botleft.gif" width=7 height=7 alt="" border=0></td>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/_spacer_blank.gif" width=735 height=7 alt="" border=0></td>
<td bgcolor="#FFFFFF"><img src="themes/ipodlounge/images/white_corner_botright.gif" width=7 height=7 alt="" border=0></td>
</tr>
</table>
<div align="center">
{LANGUAGE_SELECT_FLAGS}<br />
{THEME_SELECT_LIST}
{LANGUAGE_SELECT_LIST}
</div>
<br />
{CUSTOM_FOOTER}{VANITY}
</body>
</html>


Thanks for your help!
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Nibbler

Presumably you removed the 'my_friends' block from $template_sys_menu, so you should put it back in.

just_some_guy

Thanks, problem was i had never added it in the first place. You can mark this as solved.
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Joachim Müller

Quote from: just_some_guy on November 21, 2007, 10:28:45 PM
i have a hunch it is to do with the Modpack by Stramm.
That's correct - refer to the sticky thread "How/What to change to a theme to be 100% operational?" on the board "cpg1.4 modpack by Stramm". From that thread:
Quote from: Stramm on August 14, 2006, 08:19:21 AM
to make custom themes work together with the modpack following modifications have to be done:

[...]

4. If your theme's using a modified menu then read on further
There's a new link added to coppermines menu ( 'My friends' - for the buddy list). Cause there are several ways how one can modify the menu I just can give the direction on what to do.

Open the theme.php of the theme you want to modify and find the var $template_sys_menu_button. If the theme is using the new layout of the sys menu (you can see that if there are already lines existing like the codeline below) then just add the code below where you want it to appeare (maybe after the home link)

addbutton($s000000000ys_menu_buttons,'{MY_BUDDY_LNK}','','{MY_BUDDY_TGT}','my_friends',$template_sys_menu_spacer);


If the theme's using the old style then add something similar to the following and adapt the html to fit your layout
<!-- BEGIN my_friends -->
                                                <li class="sidebar_menu"><a href="{MY_BUDDY_TGT}" title="{MY_BUDDY_LNK}" class="navmenu">{MY_BUDDY_LNK}</a></li>
<!-- END my_friends -->

Searching for the error message you got would have told you so as well. In the future, please search before posting.