Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2011, 08:53 AM
edyy edyy is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Putting "categories" and "published by" in the same line

Hello,

In article preview we have "published by" and the "categories" each one on his own line. I want to put them in an table ( that i've managed to do it) and to be both on the same line. In the image i don't manage to put the categorie in the same line with the "published by", could anyone help me with that.
Attached Images
File Type: jpg print.jpg (152.3 KB, 0 views)
Reply With Quote
  #2  
Old 03-13-2011, 05:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post the code you have added to do this along with about 2 lines above and below your added code so we can see where in the template it is. Please post the template name also and use code tags.
Reply With Quote
  #3  
Old 03-13-2011, 06:27 PM
edyy edyy is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've edited the CSS Templates -> vbcms.css and changed the .cms_article_username into this

Code:
.article_username_container .article_username {
	width: 50%;
	display:block;
	float: {vb:stylevar left};
	clear: {vb:stylevar right};
}
.cms_article_username {
        background-image: url("http://www.games-area.ro/forum/images/box_hdr_bg.gif");
        background-position: right top;
        background-repeat: no-repeat;
        height: 26px;
        text-align: right;
        width: 100%;
        padding-right: 10px;
        padding-top: 3px;
	font-size:{vb:stylevar small_fontSize};
	padding-bottom: 2px;
	width: 100%;
	display: block;
	position: relative;
	top: 2px;
}
.cms_article_published {
	color:red;
	text-align:{vb:stylevar right};
}

After that i've changed the order of things in VBulletin CMS Templates -> vbcms_content_article_preview into that

Code:
{vb:raw css}

<div class="article_preview">
<vb:if condition="!empty($categories)">
		<div class="cms_article_section_location">
			<ol class="commalist">
				<vb:each from="categories" key="categoryid" value="category">
					<li><a href="{vb:raw category.category_url}">{vb:raw category.category}</a></li>
				</vb:each>
			</ol>
		</div>
	</vb:if>

	<vb:if condition="$showuser OR $showpublishdate OR ($viewcount AND $showviewcount) OR ($showrating AND $rating!='')">
	<div class="cms_article_username">
		<vb:if condition="$showuser">
			{vb:rawphrase by_x_nolink, {vb:raw memberaction_dropdown}}
		</vb:if>

		<vb:if condition="$showpublishdate">
            <vb:if condition="!$published OR !$setpublish">
                    <span style="color:red">
                    <vb:if condition="$publishdate AND $setpublish">
                            {vb:rawphrase page_will_be_published_x {vb:raw publishdatelocal}} {vb:raw publishtimelocal}
                    <vb:else />
                            {vb:rawphrase page_not_published}
                    </vb:if>
                    </span>
            <vb:elseif condition="$publishdate" />
                    {vb:rawphrase published_on_x {vb:raw publishdatelocal}}  {vb:raw publishtimelocal}
            </vb:if>

			<vb:if condition="$showupdated and $lastupdated">
				&nbsp;{vb:rawphrase updated_on_x {vb:date {vb:raw lastupdated}, {vb:raw dateformat}}}&nbsp;
			</vb:if>
		</vb:if>

		<vb:if condition="$viewcount AND $showviewcount">
			&nbsp;{vb:rawphrase number_of_views}: {vb:raw viewcount}&nbsp;
		</vb:if>

 		<vb:if condition="$showrating">
			<span class="cmsrating rating{vb:raw rating}"></span>
		</vb:if>

	</div>
	</vb:if>
	

	<vb:if condition="$showtitle">
	<div class="title">
		<h3 class="article_preview">
			<a href="{vb:raw page_url}"><span>{vb:raw title}</span></a>&nbsp;
		<vb:if condition="$can_edit">
			<a class="edit" href="{vb:raw edit_url}">
			<img class="editimage" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit}" />
			</a>
		</vb:if>
		</h3>
	</div>
	</vb:if>
<vb:comment>
	<!--  Display Section Location -->
	<div class="cms_article_section_location">
		{vb:rawphrase section}: <a href="{vb:raw section_url}">{vb:var parenttitle}</a>
	</div>
</vb:comment>

	<div class="fullwidth article_preview_contents<vb:if condition="$showpreviewonly"> showpreviewonly</vb:if> restore">
		<vb:if condition="$showpreviewonly">
			<vb:if condition="$previewvideo">
				{vb:raw previewvideo}
			<vb:elseif condition="$previewimage" />
				<a href="{vb:raw page_url}">
				<img class="cms_article_preview_image" src="{vb:raw previewimage}" alt="{vb:rawphrase article_preview}" /></a>
			</vb:if>
		</vb:if>
		<div>
                        <br />
			<div class="cms_article_txt_content postcontainer">
			{vb:raw previewtext}
			<vb:if condition="$preview_chopped">...</vb:if>
			</div>
		</div>
	</div>

	<div class="fullwidth">

		<vb:if condition="$preview_chopped">
			<span class="cms_article_readmore"><a href="{vb:raw page_url}">{vb:rawphrase read_more_phrase} <img src="{vb:stylevar imgdir_cms}/read_more-{vb:stylevar right}.png" alt="{vb:rawphrase read_more_phrase}" /></a>
			</span>
		</vb:if>

		<vb:if condition="$comment_count">
			<span class="cms_article_comment_number">
				<a href="{vb:raw newcomment_url}"><img class="inlineimg" src="{vb:stylevar imgdir_button}/firstnew-comment.png" alt="{vb:rawphrase go_to_first_new_comment}" /></a>
				<a href="{vb:raw newcomment_url}"  rel="nofollow">{vb:raw comment_count}
				<vb:if condition="$comment_count == 1">
					{vb:rawphrase comment}
				<vb:else />{vb:rawphrase comments}
				</vb:if></a>
			</span>
		</vb:if>
	</div>
</div>
I hope this is the best way , because is the third methed I try and i hope is the fastest.
Reply With Quote
  #4  
Old 03-13-2011, 08:31 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be much easier to see what is going on if we had a link to the page.
Reply With Quote
  #5  
Old 03-13-2011, 08:59 PM
edyy edyy is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sorry but the test server is on local machine is not up. The only modification is the one with ".cms_article_username" from the CSS Template. Or you you think is better that way show me how to do it on an standard board, just to put categories and publised by on the same line.
Reply With Quote
  #6  
Old 03-13-2011, 11:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to set .cms_article_username to only 50% (and you only need one width in there) and also float it right and make the display type inline-block. The other one, you need to float left and also make the display type inline-block. Also, since the username needs to be floated right, you actually need to have the div for that before the div for the categories.
Reply With Quote
  #7  
Old 03-14-2011, 05:53 PM
edyy edyy is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've put the site up, because i didn't manage to do what you said to me. The link is http://test.games-area.ro/content.php, i hope this will make you understand better what i want
Reply With Quote
  #8  
Old 03-14-2011, 06:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Remove the clear statement from .cms_article_section_location
Reply With Quote
  #9  
Old 03-14-2011, 06:44 PM
edyy edyy is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When i make the image 100% the categories goes underline, i want it to be on the same line (like the published by ). I made the width back to 100% to see it more clear
Reply With Quote
  #10  
Old 03-14-2011, 10:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to add the background to the Categories strip also. What you really should do is have one div that has the background and is 100%, then inside that div, have a div for the categories and the div for the Published by.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:29 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09418 seconds
  • Memory Usage 2,273KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete