vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Two small code changes (https://vborg.vbsupport.ru/showthread.php?t=159692)

aceofspades 10-07-2007 01:52 PM

Two small code changes
 
Quote:

<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<div align="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</div>
Im having two problems with this code. First of all, its aligning the date on the right which is what i want, but its dropping it down on another line, i want the date to be on the same line as the name. I dont have any <br />'s there so i dont know why its doing that.

Also the second problem (which isnt a big deal) is that when i click anywhere on the line that the posters name is on the postbit legacy, the box comes up with find more posts by this user etc. I dont want it to do this, only when the user clicks on the actual name not the line do i want the box to come up.

Can anyone help me with either of these?

James

Lynne 10-07-2007 04:36 PM

A div tag is a block element, thus it goes to the next line (as you are seeing). Try using span tags instead of the div tags and see if that works.

As for the second one, your javascript is running on the div element "postmenu_$post[postid]". So, if you click anywhere inside that div element, you are running the javascript "vbmenu_register("postmenu_$post[postid]", true)"

aceofspades 10-07-2007 05:21 PM

Thank you for the reply. I tried two different things, and i couldnt get the result with either one.

Attempt One (span for date):

Quote:

$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<div>
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>
With this result the text was on the left and still on the line below.

Attempt Two (Span for both the name and date):

Quote:

$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<span class="left">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</span>
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>
Got to the point there the date is on the same line as the name, but its not on the right, its just next to it, and on top of that the javascript popup box doesnt open at all now, but ill worry about fixing that later. Can you offer any more advice?

James

Lynne 10-07-2007 05:46 PM

Try this:
Code:

$template_hook[postbit_messagearea_start]
<!-- icon and title -->
<span class="right">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
</span>
<span class="left">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</span>


aceofspades 10-07-2007 05:57 PM

Now they are on the same line, but the date is on the left in front of the name, like this:

08-25-2007 aceofspades

--------------- Added at 21:52 ---------------

Got this working :)

Lynne 10-07-2007 10:24 PM

Whoops, I didn't bother to look at your span tags. Do you have a class called right and left? If not, <span style="float:right"> should be written instead of <span class="right">

aceofspades 10-08-2007 10:26 AM

Yeah thats how i got it working in the end.


All times are GMT. The time now is 10:16 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.01022 seconds
  • Memory Usage 1,732KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete