Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Design and Graphics Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2012, 03:00 PM
peugeot405's Avatar
peugeot405 peugeot405 is offline
 
Join Date: Feb 2010
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default issue with blog statistics on forumhome statistics

Hi all,

I seem to have an issue with issue with blog statistics on forumhome statistics on my custom skin.

I customized the template blog_forumhome_stats to match the statistics on forumhome. (see pic1)

Attachment 140279

I replaced
Code:
<dl>
	<dt>{vb:rawphrase blogs}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=bloglist">{vb:raw blogstats.total_blog_users}</a></dd>
	<dt>{vb:rawphrase entries}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=list">{vb:raw blogstats.total_blog_entries}</a></dd>
	<dt>{vb:rawphrase last_24_hours}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=list&amp;span=24">{vb:raw blogstats.entries_in_24hours}</a></dd>
</dl>

<vb:if condition="$latestentry['title']">
	<p>
		<vb:if condition="$show['blogtitle']">
         {vb:rawphrase latest_blog_entry_by_x_in_blog_y, {vb:link entry, {vb:raw latestentry}, null, blogid, title}, {vb:raw latestentry.title}, {vb:link member, {vb:raw latestentry}, null, postedby_userid, postedby_username}, {vb:raw latestentry.postedby_username}, {vb:link blog, {vb:raw latestentry}, null, userid, blogtitle}, {vb:raw latestentry.blogtitle}}
		<vb:else />
         {vb:rawphrase latest_blog_entry_by_x, {vb:link entry, {vb:raw latestentry}, null, blogid, title}, {vb:raw latestentry.title}, {vb:link member, {vb:raw latestentry}, null, postedby_userid, postedby_username}, {vb:raw latestentry.postedby_username}}
		</vb:if>
	</p>
</vb:if>
with

Code:
			<div id="wgo_stats" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" /></h3>
				<div class="wgo_new_blk1">
<dl>
	<dt>{vb:rawphrase blogs}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=bloglist">{vb:raw blogstats.total_blog_users}</a></dd>
	<dt>{vb:rawphrase entries}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=list">{vb:raw blogstats.total_blog_entries}</a></dd>
	<dt>{vb:rawphrase last_24_hours}</dt>
	<dd><a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}do=list&amp;span=24">{vb:raw blogstats.entries_in_24hours}</a></dd>
</dl>

<vb:if condition="$latestentry['title']">
	<p>
		<vb:if condition="$show['blogtitle']">
         {vb:rawphrase latest_blog_entry_by_x_in_blog_y, {vb:link entry, {vb:raw latestentry}, null, blogid, title}, {vb:raw latestentry.title}, {vb:link member, {vb:raw latestentry}, null, postedby_userid, postedby_username}, {vb:raw latestentry.postedby_username}, {vb:link blog, {vb:raw latestentry}, null, userid, blogtitle}, {vb:raw latestentry.blogtitle}}
		<vb:else />
         {vb:rawphrase latest_blog_entry_by_x, {vb:link entry, {vb:raw latestentry}, null, blogid, title}, {vb:raw latestentry.title}, {vb:link member, {vb:raw latestentry}, null, postedby_userid, postedby_username}, {vb:raw latestentry.postedby_username}}
		</vb:if>
	</p>
</vb:if>
                                </div>
                           </div>
the problem is when i reimport the skin the template blog_forumhome_stats is reverted back to the original state and the statistic is messed up. (see pic2)

Attachment 140280

Any idee why this is happening and how to avoid that?

I tried to alter the statistics on forumhome template as well but then i hav another issue. When blog is disabled in plugin manager or the user doesn't have view and post permission the statistics itself are gone, showing an empty block. (see pic3)

Attachment 140281

what's going on coding on forumhome template:

Code:
<!-- what's going on box -->
	<div id="wgo" class="collapse wgo_block block">
		<h2 class="blockhead">{vb:rawphrase whats_going_on}</h2>
		<div class="blockbody formcontrols floatcontainer">
			{vb:raw template_hook.forumhome_wgo_pos1}
			<vb:if condition="$show['loggedinusers']">
						<!-- logged-in users -->
			<div id="wgo_onlineusers" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" /></h3>
				<div class="wgo_new_blk1">
                                     <div class="wgo_infolist_blk">
					<p>{vb:rawphrase there_are_x_y_online_link, {vb:raw totalonline}, {vb:raw session.sessionurl_q}} <span class="shade_wgo">{vb:rawphrase x_members_and_y_guests, {vb:raw numberregistered}, {vb:raw numberguest}}</span></p>
					<p>{vb:rawphrase most_users_ever_online_was_x_y_at_z, {vb:raw recordusers}, {vb:raw recorddate}, {vb:raw recordtime}}</p>
					<p><vb:if condition="$activeusers">
					<ol class="commalist" id="wgo_onlineusers_list">
						<vb:each from="activeusers" value="loggedin">
							<li>{vb:stylevar dirmark}<a class="username" href="{vb:link member, {vb:raw loggedin}}">{vb:raw loggedin.musername}</a>{vb:raw loggedin.invisiblemark}{vb:raw loggedin.buddymark}{vb:raw loggedin.comma}</li>
						</vb:each>
					</ol>
					</vb:if></p>
					</div>

				</div>
			</div>
			<!-- end logged-in users -->
			</vb:if>
			{vb:raw template_hook.forumhome_wgo_pos2}
			<!-- Start Members Today -->
			<vb:if condition="$show['wgo_members']">
			<div id="wgo_wgo_members_users" class="wgo_subblock section collapse">
				<h3 class="blocksubhead"><a href="{vb:raw wgo_members.url}"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:phrase wgo_members_alt_title}"/></a></h3>
<div class="wgo_new_blk1">
				<!--<a class="collapse" id="collapse_wgo_members_list" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse_40b{vb:raw wgo_members.collapse}.png" alt="" title="{vb:rawphrase collapse_expand}" /></a>-->
					<p>{vb:raw wgo_members.visitors}</p>
					<vb:if condition="$vboptions['wgo_members_names']">
						<vb:if condition="$wgo_members['totaltoday'] == 0">
							{vb:phrase no_members_list} 
						<vb:else />
							<ul class="commalist" id="wgo_wgo_members_list">
								<vb:if condition="$wgo_members['template_hook']">
									{vb:raw wgo_members.template_hook}
								<vb:else />
									<vb:each from="wgo_members_list" value="row">
										<li>{vb:stylevar dirmark}<a class="username" href="{vb:link member, {vb:raw row}}" title="{vb:raw row.wrdate}">{vb:raw row.musername}</a>{vb:raw row.markinv}{vb:raw row.comma}</li>
									</vb:each>
								</vb:if>
							</ul>
						</vb:if>
					<vb:else />
						{vb:phrase member_list_disabled} 
					</vb:if>

</div>
			</div>
			</vb:if>
			<!-- End Members Today -->
			{vb:raw template_hook.forumhome_wgo_pos6}
			<vb:if condition="$show['upcomingevents']">
			<div id="wgo_events" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/event.png" alt="{vb:rawphrase todays_events}" /></h3>
<div class="wgo_new_blk1">
				<ol>
					{vb:raw upcomingevents}
				</ol>
			</div>
			</div>
			</vb:if>
			{vb:raw template_hook.forumhome_wgo_pos3}
			<vb:if condition="$show['birthdays']">
			<!-- today's birthdays -->
			<div id="wgo_birthdays" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/birthday.png" alt="{vb:rawphrase todays_birthdays}" /></h3>
				<div class="wgo_new_blk1">
				<ol class="commalist">
					<vb:each from="birthdays" value="row">
						<li><a href="{vb:link member, {vb:raw row}}">{vb:raw row.username}</a><vb:if condition="$row['age']"> ({vb:raw row.age})</vb:if>{vb:raw row.comma}</li>
					</vb:each>
				</ol>
			</div>
			</div>
			<!-- end today's birthdays -->
			</vb:if>
			{vb:raw template_hook.forumhome_wgo_pos4}
			<div id="wgo_stats" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" /></h3>
				<div class="wgo_new_blk1">
					<dl>
						<dt>{vb:rawphrase threads}</dt>
							<dd>{vb:raw totalthreads}</dd>
						<dt>{vb:rawphrase posts}</dt>
							<dd>{vb:raw totalposts}</dd>
						<dt>{vb:rawphrase members}</dt>
							<dd>{vb:raw numbermembers}</dd>
						<vb:if condition="$show['activemembers']">
							<dt>{vb:rawphrase active_members}</dt>
							<dd>{vb:raw activemembers}</dd>
						</vb:if>
					</dl>
					<p>{vb:rawphrase welcome_to_our_newest_member_x, {vb:link member, {vb:raw newuserinfo}}, {vb:raw newuserinfo.username}}</p>

				</div>
			</div>
					{vb:raw template_hook.forumhome_wgo_stats}

			<div id="wgo_legend" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/legend.png" alt="{vb:rawphrase icon_legend}" /></h3>
				<div class="wgo_new_blk1">
					<dl class="icon_legends dvb_fh" id="icon_legends">
						<dt><img src="{vb:stylevar imgdir_statusicon}/forum_new-16.png" alt="{vb:rawphrase new_posts_forum}" /></dt><dd>{vb:rawphrase new_posts_forum}</dd>
						<dt><img src="{vb:stylevar imgdir_statusicon}/forum_old-16.png" alt="{vb:rawphrase no_new_posts_forum}" /></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
						<vb:if condition="$vboptions['showlocks']"><dt><img src="{vb:stylevar imgdir_statusicon}/forum_lock-16.png" alt="{vb:rawphrase forum_is_closed_for_posting}" /></dt><dd>{vb:rawphrase forum_is_closed_for_posting}</dd></vb:if>
						<dt><img src="{vb:stylevar imgdir_statusicon}/category-16.png" alt="{vb:rawphrase category_forum}" /></dt><dd>{vb:rawphrase category_forum}</dd>
						<dt><img src="{vb:stylevar imgdir_statusicon}/forum_link-16.png" alt="{vb:rawphrase link_forum}" /></dt><dd>{vb:rawphrase link_forum}</dd>
					{vb:raw template_hook.forumhome_icon_legend}
					</dl>
				</div>
			</div>
			{vb:raw template_hook.forumhome_wgo_pos5}
		</div>
	</div>
	<!-- end what's going on box -->
I guess i would require some conditionals to hide it if no permission or disabled. The only thing I found is this php coding in plugin manager forum_home_complete:

Code:
if (is_array($vbulletin->blogstats) AND $vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewothers'])
{
    if ($latestentry = $vbulletin->blogstats['lastentry'])
    {
        require_once(DIR . '/includes/blog_functions_shared.php');
        prepare_blog_category_permissions($vbulletin->userinfo);

        if ($vbulletin->userinfo['userid'] OR $latestentry['guestcanview'])
        {
            $entrycats = explode(',', $latestentry['categories']);
            if (array_intersect($vbulletin->userinfo['blogcategorypermissions']['cantview'], $entrycats) AND $vbulletin->userinfo['userid'] != $latestentry['userid'])
            {
                $latestentry = fetch_latest_entry($vbulletin->userinfo);
            }
            else if ($vbulletin->userinfo['userid'] == $latestentry['userid'] AND !($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown']))
            {
                $latestentry = fetch_latest_entry($vbulletin->userinfo);
            }
            else if (in_coventry($latestentry['userid']) AND $vbulletin->userinfo['userid'] != $latestentry['userid'])
            {
                $latestentry = fetch_latest_entry($vbulletin->userinfo);
            }
        }
        else if ($latestentry = $vbulletin->blogstats['lastentry_guest'])
        {
            // oh do nothing, we just wanted the assignment ;)
        }
    }

    if ($latestentry['userid'] != $latestentry['postedby_userid'] OR !empty($latestentry['blogtitle']))
    {
        $show['blogtitle'] = true;
        if (empty($latestentry['blogtitle']))
        {
                $latestentry['blogtitle'] = $latestentry['username'];
        }
    }

    $blogstats['total_blog_users'] = vb_number_format($vbulletin->blogstats['total_blog_users']);
    $blogstats['total_blog_entries'] = vb_number_format($vbulletin->blogstats['total_blog_entries']);
    $blogstats['entries_in_24hours'] = vb_number_format($vbulletin->blogstats['entries_in_24hours']);

    $templater = vB_Template::create('blog_forumhome_stats');
        $templater->register('blogstats', $blogstats);
        $templater->register('latestentry', $latestentry);
    $template_hook['forumhome_wgo_stats'] .= $templater->render();
}
Reply With Quote
  #2  
Old 08-03-2012, 04:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can we get a link to see the problem.

Also, make sure you only use an id once per page or you could have odd things go on.
Reply With Quote
  #3  
Old 08-03-2012, 04:23 PM
peugeot405's Avatar
peugeot405 peugeot405 is offline
 
Join Date: Feb 2010
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for replying Lynne,

Quote:
Originally Posted by Lynne View Post
Can we get a link to see the problem.

Also, make sure you only use an id once per page or you could have odd things go on.
its a developper site on local host using xampp, not quite sure what the link would be. I can give you acces through a screen sharing program.

i affraid i don't understand what you mean with only use an id once per page. I'm still very novice when it comes to coding.
Reply With Quote
  #4  
Old 08-03-2012, 07:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You posted that you changed the blogs stats to something that starts with this line:
<div id="wgo_stats" class="wgo_subblock section">

That id, wgo_stats, is already being used on the page (normally). So, you cannot have two areas on that page with that id.
Reply With Quote
  #5  
Old 08-03-2012, 07:59 PM
peugeot405's Avatar
peugeot405 peugeot405 is offline
 
Join Date: Feb 2010
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You posted that you changed the blogs stats to something that starts with this line:
<div id="wgo_stats" class="wgo_subblock section">

That id, wgo_stats, is already being used on the page (normally). So, you cannot have two areas on that page with that id.
ok so i changed wgo_stats and changed wgo_subblock as well and even every bit of coding i added, but the results is the seem.

I affraid i'm gonna need more information on this.

Would it be possible to change it on forumhome instead and add a conditional to hide it if blog is disabled or doesn't have permission to view own and others' blog

--------------- Added [DATE]1344030995[/DATE] at [TIME]1344030995[/TIME] ---------------

I reverted the blog_forumhome_stats template back to its original state and changed the following on forumhome template:

I changed:

Code:
	
					{vb:raw template_hook.forumhome_wgo_stats}
with:

Code:
			<div id="wgo_stats" class="wgo_subblock section">
				<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" /></h3>
				<div class="wgo_new_blk1">
					{vb:raw template_hook.forumhome_wgo_stats}
				</div>
			</div>
that resolves the problem with the messud up blog stats when reimporting the skin.

Now i need to find the conditionals to hide that complete block when blog is disabled in product manager or user doesn't have permission to view own and others' blogs. (see pic3 in first post)

Any idee?
Reply With Quote
Reply


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 09:54 PM.


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.11280 seconds
  • Memory Usage 2,250KB
  • Queries Executed 14 (?)
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
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete