Default Avatar

Styles, Theme, Cosmetic and Appearance related tips, tricks, tweaks, and Graphics

Moderator: STG Styles Team

Forum rules
NOTE: Post full styles only in the Styles Forum

Re: Default Avatar

Postby Stoker » 17 Jul 2008, 01:55

I have testet this code and it is working:
Code: Select all
<!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><!-- ELSE --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )"><img src="{T_THEME_PATH}/images/no_avatar.gif" width="90" height="90" alt="" /></a>
                             <!-- ENDIF -->
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Default Avatar

Postby sunka » 17 Jul 2008, 02:28

Highslide and dimming workin OK...thanks Stoker

Ihave changed code again, look (with some lines above, and after modification for clearer view):

Code: Select all
<!-- IF not postrow.S_IGNORE_POST -->
         <dl class="postprofile" id="profile{postrow.POST_ID}">
         <dt>
            <!-- IF postrow.POSTER_AVATAR -->
               <a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br /><!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" width="90" height="90" alt="" /><br />
            <!-- ENDIF -->
            <!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
         </dt>


And it is still not working...something conflict there, and I do not know what
sunka    
Crewman
Crewman
 
Posts: 9
Joined: 07 Apr 2008, 09:39
Gender: Male
phpBB Knowledge: 2

Re: Default Avatar

Postby Stoker » 17 Jul 2008, 02:49

You are not using the code I have posted.

Replace this code:
Code: Select all
<!-- IF not postrow.S_IGNORE_POST -->
         <dl class="postprofile" id="profile{postrow.POST_ID}">
         <dt>
            <!-- IF postrow.POSTER_AVATAR -->
               <a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br /><!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" width="90" height="90" alt="" /><br />
            <!-- ENDIF -->
            <!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
         </dt>


with this code:
Code: Select all
<!-- IF not postrow.S_IGNORE_POST -->
         <dl class="postprofile" id="profile{postrow.POST_ID}">
         <dt>
            <!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><!-- ELSE --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )"><img src="{T_THEME_PATH}/images/no_avatar.gif" width="90" height="90" alt="" /></a>
                             <!-- ENDIF --><br />
            <!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
         </dt>


Then it should work.
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: Default Avatar

Postby sunka » 17 Jul 2008, 03:29

No, then is error:
Parse error: syntax error, unexpected $end in /home/pijanitv/public_html/forum/includes/template.php(175) : eval()'d code on line 240

Line 240 is empty

this is lines from includes/template.php (lines from 234 to 244)

Spoiler:
Code: Select all
// Just compile if no user object is present (happens within the installer)
      if (!$user)
      {
         $compile->_tpl_load_file($handle);
         return false;
      }

      if (isset($user->theme['template_storedb']) && $user->theme['template_storedb'])
      {
         $sql = 'SELECT *
            FROM ' . STYLES_TEMPLATE_DATA_TABLE . '


this is lines from includes/template.php (lines from 169 to 249)

Spoiler:
Code: Select all
if ($filename = $this->_tpl_load($handle))
      {
         ($include_once) ? include_once($filename) : include($filename);
      }
      else
      {
         eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
      }

      return true;
   }

   /**
   * Display the handle and assign the output to a template variable or return the compiled result.
   * @access public
   */
   function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
   {
      ob_start();
      $this->display($handle, $include_once);
      $contents = ob_get_clean();

      if ($return_content)
      {
         return $contents;
      }

      $this->assign_var($template_var, $contents);

      return true;
   }

   /**
   * Load a compiled template if possible, if not, recompile it
   * @access private
   */
   function _tpl_load(&$handle)
   {
      global $user, $phpEx, $config;

      $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;

      $recompile = (($config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename) || @filesize($filename) === 0) ? true : false;

      // Recompile page if the original template is newer, otherwise load the compiled version
      if (!$recompile)
      {
         return $filename;
      }

      global $db, $phpbb_root_path;

      if (!class_exists('template_compile'))
      {
         include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
      }

      $compile = new template_compile($this);

      // If we don't have a file assigned to this handle, die.
      if (!isset($this->files[$handle]))
      {
         trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
      }

      // Just compile if no user object is present (happens within the installer)
      if (!$user)
      {
         $compile->_tpl_load_file($handle);
         return false;
      }

      if (isset($user->theme['template_storedb']) && $user->theme['template_storedb'])
      {
         $sql = 'SELECT *
            FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
            WHERE template_id = ' . $user->theme['template_id'] . "
               AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
                  OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')';
         $result = $db->sql_query($sql);
         $row = $db->sql_fetchrow($result);


I think because of this line ((prosilver/template/viewtopic_body.html):
<!-- IF postrow.U_POST_AUTHOR -->
sunka    
Crewman
Crewman
 
Posts: 9
Joined: 07 Apr 2008, 09:39
Gender: Male
phpBB Knowledge: 2

Re: Default Avatar

Postby Stoker » 17 Jul 2008, 03:56

sunka wrote:
I think because of this line ((prosilver/template/viewtopic_body.html):
<!-- IF postrow.U_POST_AUTHOR -->


Nope, that one is standard phpbb3.
The code I have posted here works: viewtopic.php?f=83&t=4968&p=79891#p79880
You have an error in one of the other profile field mods You have installed.
Go through the install instructions of this mods and see if You can find the error. Start with the one latest installed.
Else You have to start over with a fresh viewtopic_body.html and install the mods one by one until You find the error.
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: Default Avatar

Postby sunka » 17 Jul 2008, 16:59

Find it!!!!!!
LOL :yahoo:
One <!-- ENDIF --> is missing some lines above change...
I use winmerge and look vanilla (virgin) file of v3.0.2 and it is seems to me that this bloody <!-- ENDIF --> should be there in my file but he is not there. LOL
Stoker thanks for all. Croatia is your friend. Valhalla is for brave and clever people like you Stoker. It was my honor to find solution with your guideing


Code: Select all
<!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><!-- ELSE --><a href="{postrow.U_POST_AUTHOR}#viewprofile" onclick="return hs.htmlExpand(this, { objectType: 'ajax', width: 700, slideshowGroup: '{postrow.U_PROFILE}'} )"><img src="{T_THEME_PATH}/images/no_avatar.gif" width="90" height="90" alt="" /></a>
                             <!-- ENDIF --><br />


And few lins above all this, must be bloody <!-- ENDIF --> (like he is in default vanilla files)
sunka    
Crewman
Crewman
 
Posts: 9
Joined: 07 Apr 2008, 09:39
Gender: Male
phpBB Knowledge: 2

Re: Default Avatar

Postby Stoker » 17 Jul 2008, 23:07

I am glad You got it working sunka :)
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: Default Avatar

Postby _Chris_ » 19 Aug 2010, 09:12

Sorry, getting a little confused, have followed all the pages in this thread, but what is the correct code to find and the correct code to replace it with please ?

Any help appreciated.

Chris
_Chris_
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 169
Joined: 19 Aug 2010, 09:06
Gender: Male
phpBB Knowledge: 1

Re: Default Avatar

Postby _Chris_ » 20 Aug 2010, 07:59

Anyone here ? Or should this be posted in another section here?

Any help appreciated.
_Chris_
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 169
Joined: 19 Aug 2010, 09:06
Gender: Male
phpBB Knowledge: 1

Re: Default Avatar

Postby Sniper_E » 20 Aug 2010, 08:14

What exactly are you wanting to do Chris?
Have you looked in your viewtopic_body.html template for the avatar codes?
Are you working with a prosilver or a subsilver2 type style?

This mod simply uses an IF statement, ELSE statement and ENDIF statement.
Show what you have tried so far and what it's doing in your style.

For prosilver
Code: Select all
            <!-- IF postrow.POSTER_AVATAR -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
            <!-- ELSE -->
               <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}"><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /></a><!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --><br />
            <!-- ENDIF -->

Check Stoker's first post, he has good directions on how to add this.
Don't let these latest codes confuse you. These guys are adding the Highslide mod in their codes.
Use the first post's codes to add a default avatar in your viewtopic.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7005
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Previous

Return to Styles Tweaks, Tips and Graphics

Who is online

Users browsing this forum: No registered users and 5 guests

cron