vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Miscellaneous Hacks - DJ's Dynamic Tab Content for Postbit_Legacy (https://vborg.vbsupport.ru/showthread.php?t=184136)

Digital Jedi 09-22-2009 12:32 AM

The boxes are added by using the info class that comes with a lot of forum skins. Some skins use different names so people just change the class names on the inner DIV containers to whatever it is they use. Your skin might not have one, but you can create one using CSS to look pretty much however you want. I use a box with 2 pixels width on the right and bottom and one pixel width on the left and top to create the illusion of a shadow.

Mobo 09-22-2009 02:57 AM

Thanks, I'll look into the classes my style uses and see about creating one if needed.


Wondering if I could get a little help. I've gotten most of my bit stuff worked out the way I want them. I have having problems with moving the Albums link/icon to one of the tabs and the same thing with the awards.

They both use a hook location and php code in the actual plugin.

Digital Jedi 09-22-2009 04:51 AM

Quote:

Originally Posted by Mobo (Post 1888778)
Thanks, I'll look into the classes my style uses and see about creating one if needed.


Wondering if I could get a little help. I've gotten most of my bit stuff worked out the way I want them. I have having problems with moving the Albums link/icon to one of the tabs and the same thing with the awards.

They both use a hook location and php code in the actual plugin.

Check the FAQ on the first page of this thread, as I'm sure you should be able to use one of those solutions.

Mobo 09-22-2009 02:26 PM

I've been trying to figure it out from that FAQ. For the album like, I traced down this code...

Code:

if (!empty($post['hasalbum']))
{

$template_hook['postbit_userinfo_right'] .= '<div><a href="album.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $post['userid'] . '" rel="nofollow"><img src="images/buttons/add_album.png" border="0" alt="Member Photo Albums"></a></div>';

}


There is no call to a template, and I can't find any HTML for it. When I place that into a tab, I get this error in vB before the template will save...

Code:

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hermes/web05/b980/pow.mobowow/htdocs/forums/includes/adminfunctions_template.php(3939) : eval()'d code on line 132

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Digital Jedi 09-22-2009 05:05 PM

There is not a template being used in that instance. The HTML is there after the template hook.

HTML Code:

<div><a href="album.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $post['userid'] . '" rel="nofollow"><img src="images/buttons/add_album.png" border="0" alt="Member Photo Albums"></a></div>
You don't copy the entirety of the plugin in any case, as a template won't parse PHP. HTML inside of a plugin or PHP file will be specially formatted to prevent errors. You can tell what it is by the use of traditional HTML tags being used, such as the <div> tag in this case. You just need to strip out the PHP stuff, like the single quotes, the decimal points and spaces. Probably something like this:

HTML Code:

<div><a href="album.php?$session[sessionurl]u=$post['userid']" rel="nofollow"><img src="images/buttons/add_album.png" border="0" alt="Member Photo Albums"></a></div>
Note that I also changed the PHP variable to the kind that vB templates typically use.

Mobo 09-23-2009 05:48 AM

Sorry, I did only add the part in the <div> section. I will try and strip out the PHP code stuff from my various plugins I need.

Thanks for the help and support.

Mobo 09-23-2009 10:47 AM

Okay, I got every thing sorted and it is working great. Every thing is in the tabs I want and I even got the .info class to work.

Now I'm having a very odd issues. For some of the users (they are not in the same usergroups) the text does not appear the same as other users in some of the tabs (not all tabs). Also, for these same users, my Reputation icon that is assigned to tab one only, shows up at the top of all the other tabs.

If you would like to have a look, see posts 18-20 on this thread. User Jmac, post #19 is one of the members having this odd issue. Post #18 and #20 do not have this issue.

Just encase you want it, here is my code for the tabs...

Code:

<!-- BEGIN POSTBIT TABS -->
<div id="postbittabs$post[postid]" class="djdot">
 
<ul>
<li><span title="User Info"><a href="#" rel="tab1$post[postid]" id="selected$post[postid]">&nbsp;</a></span></li>
<li><span title="Game Info"><a href="#" rel="tab2$post[postid]">&nbsp;</a></span></li>
<li><span title="Files Info"><a href="#" rel="tab3$post[postid]">&nbsp;</a></span></li>
<li><span title="Medals"><a href="#" rel="tab4$post[postid]">&nbsp;</a></span></li>
<li><span title="Contact"><a href="#" rel="tab5$post[postid]">&nbsp;</a></span></li>
</ul>
 
<br style="clear: left" />
 
</div>
 
<div class="smallfont" align= "left" >
 
<!--TAB 1 CONTENT -->
<div id="tab1$post[postid]" class="tabcontent" >
 
<div class="info">$vbphrase[posts]: $post[posts]</div>

<div class="info"><if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if></div>
       
<if condition="$post['field7']"><div class="info">Group: $post[field7]</if></div>

<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
             
             
 
</div> 
<!-- TAB 2 CONTENT -->
<div id="tab2$post[postid]" class="tabcontent">
 
<if condition="$post[field6]"><div class="info">Favorite Plane: $post[field6]</div></if>
<if condition="$post[field21]"><div class="info">Side: $post[field21]</div></if>
<if condition="$post[field22]"><div class="info">War: $post[field22]</div></if> 
</div>
 
<!-- TAB 3 CONTENT -->
<div id="tab3$post[postid]" class="tabcontent">
 
<if condition="$post[downloads]>0"><div class="info">{$vbphrase['ecdownloads_downloads']}: $post[downloads]</div></if>
<if condition="$post[uploads]>0"><div class="info"><a href="member.php?$session[sessionurl]u=$post[userid]&tab=dl2modification">{$vbphrase['ecdownloads_uploads']}: $post[uploads]</a></div></if>

<div class="info"><a href="album.php?u=$post[userid]" title="View $post[username]'s Album" rel="nofollow"><img src="images/buttons/add_album.png" alt="Member's Picture Albums" border="0"/></a>  </div>
</div>
 
<!-- TAB 4 CONTENT -->
<div id="tab4$post[postid]" class="tabcontent">
 
<if condition="$post[showuserawards]"><div class="info">$post[userawards]</div></if>
 
</div>
 
<!-- TAB 5 CONTENT -->
<div id="tab5$post[postid]" class="tabcontent">
 
<div class="info">
<if condition="$show['pmlink'] OR $show['emaillink'] OR $post['userid'] AND $show['member']">
Send $post[username]:<br /></if>
        <if condition="$show['pmlink']">
  <a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">a Private Message</a><br />
 </if>
  <if condition="$post['userid'] AND $show['member']">
 <a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]">a Friend Request</a>
 </if></div>
<br />
 <div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
                        </div>
 
</div>
 
</div>
 
 
<script type="text/javascript">
var mytabs=new ddtabcontent("postbittabs$post[postid]")
mytabs.setpersist(false)
mytabs.setselectedClassTarget("link")
mytabs.init()
</script>
 
<!-- END POSTBIT TABS -->

Sorry to be such a bother!

Digital Jedi 09-23-2009 08:33 PM

Quote:

Originally Posted by Mobo (Post 1889342)
Okay, I got every thing sorted and it is working great. Every thing is in the tabs I want and I even got the .info class to work.

Now I'm having a very odd issues. For some of the users (they are not in the same usergroups) the text does not appear the same as other users in some of the tabs (not all tabs). Also, for these same users, my Reputation icon that is assigned to tab one only, shows up at the top of all the other tabs.

If you would like to have a look, see posts 18-20 on this thread. User Jmac, post #19 is one of the members having this odd issue. Post #18 and #20 do not have this issue.

Just encase you want it, here is my code for the tabs...

Code:

<!-- BEGIN POSTBIT TABS -->
<div id="postbittabs$post[postid]" class="djdot">
 
<ul>
<li><span title="User Info"><a href="#" rel="tab1$post[postid]" id="selected$post[postid]">&nbsp;</a></span></li>
<li><span title="Game Info"><a href="#" rel="tab2$post[postid]">&nbsp;</a></span></li>
<li><span title="Files Info"><a href="#" rel="tab3$post[postid]">&nbsp;</a></span></li>
<li><span title="Medals"><a href="#" rel="tab4$post[postid]">&nbsp;</a></span></li>
<li><span title="Contact"><a href="#" rel="tab5$post[postid]">&nbsp;</a></span></li>
</ul>
 
<br style="clear: left" />
 
</div>
 
<div class="smallfont" align= "left" >
 
<!--TAB 1 CONTENT -->
<div id="tab1$post[postid]" class="tabcontent" >
 
<div class="info">$vbphrase[posts]: $post[posts]</div>

<div class="info"><if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if></div>
       
<if condition="$post['field7']"><div class="info">Group: $post[field7]</if></div>

<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
             
             
 
</div> 
<!-- TAB 2 CONTENT -->
<div id="tab2$post[postid]" class="tabcontent">
 
<if condition="$post[field6]"><div class="info">Favorite Plane: $post[field6]</div></if>
<if condition="$post[field21]"><div class="info">Side: $post[field21]</div></if>
<if condition="$post[field22]"><div class="info">War: $post[field22]</div></if> 
</div>
 
<!-- TAB 3 CONTENT -->
<div id="tab3$post[postid]" class="tabcontent">
 
<if condition="$post[downloads]>0"><div class="info">{$vbphrase['ecdownloads_downloads']}: $post[downloads]</div></if>
<if condition="$post[uploads]>0"><div class="info"><a href="member.php?$session[sessionurl]u=$post[userid]&tab=dl2modification">{$vbphrase['ecdownloads_uploads']}: $post[uploads]</a></div></if>

<div class="info"><a href="album.php?u=$post[userid]" title="View $post[username]'s Album" rel="nofollow"><img src="images/buttons/add_album.png" alt="Member's Picture Albums" border="0"/></a>  </div>
</div>
 
<!-- TAB 4 CONTENT -->
<div id="tab4$post[postid]" class="tabcontent">
 
<if condition="$post[showuserawards]"><div class="info">$post[userawards]</div></if>
 
</div>
 
<!-- TAB 5 CONTENT -->
<div id="tab5$post[postid]" class="tabcontent">
 
<div class="info">
<if condition="$show['pmlink'] OR $show['emaillink'] OR $post['userid'] AND $show['member']">
Send $post[username]:<br /></if>
        <if condition="$show['pmlink']">
  <a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">a Private Message</a><br />
 </if>
  <if condition="$post['userid'] AND $show['member']">
 <a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]">a Friend Request</a>
 </if></div>
<br />
 <div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
                        </div>
 
</div>
 
</div>
 
 
<script type="text/javascript">
var mytabs=new ddtabcontent("postbittabs$post[postid]")
mytabs.setpersist(false)
mytabs.setselectedClassTarget("link")
mytabs.init()
</script>
 
<!-- END POSTBIT TABS -->

Sorry to be such a bother!

In Tab 1, you have a couple of improperly nested tags that's no doubt causing a cascade effect.

Code:

<!--TAB 1 CONTENT -->
<div id="tab1$post[postid]" class="tabcontent" >
 
<div class="info">$vbphrase[posts]: $post[posts]</div>

<div class="info"><if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if></div>
       
<if condition="$post['field7']"><div class="info">Group: $post[field7]</if></div>

<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
             
             
 
</div>

Also, and this is probably an error in my documentation, but it appears that the Private Message link is missing it's closing </phrase> tag. There should be one before the </a>:

Code:

<!-- TAB 5 CONTENT -->
<div id="tab5$post[postid]" class="tabcontent">
 
<div class="info">
<if condition="$show['pmlink'] OR $show['emaillink'] OR $post['userid'] AND $show['member']">
Send $post[username]:<br /></if>
        <if condition="$show['pmlink']">
  <a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">a Private Message</phrase></a><br />
 </if>
  <if condition="$post['userid'] AND $show['member']">
 <a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]">a Friend Request</a>
 </if></div>
<br />
 <div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
                        </div>
 
</div>


MissKalunji 09-23-2009 10:12 PM

I can't seem to see what change in the new version?

Mobo 09-24-2009 07:05 AM

Thank you! I've got it all sorted out now!


All times are GMT. The time now is 08:59 AM.

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.01468 seconds
  • Memory Usage 1,811KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete