vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Display albums in member profile (https://vborg.vbsupport.ru/showthread.php?t=267149)

Lynne 06-16-2013 03:45 PM

I was not talking about the template names, but about the id for your tab:

HTML Code:

<div id="view-photos"
Change that to mpphotos now.

HTML Code:

<div id="view-mpphotos"
Remove this:
PHP Code:

$templater vB_Template::create('memberinfo_block_mpphotos');
$templater->register('albumbits2'$albumbits2); 

Replace with:
PHP Code:

vB_Template::preRegister('memberinfo_block_photos', array('albumbits2' => $albumbits2));   
vB_Template::preRegister('memberinfo_block_photos', array('albumcount' => $albumcount)); 

(You didn't put in code for the albumcount, so do that too and any other variable in that template.)

Honourable 06-16-2013 03:48 PM

seconds just testing

pair with me kindly

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

I did to the code exactly as you said but it doesnt work????

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

btw my vbulletin version is 4.2.0

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

heeeeeeeeeeeeeeey it does work i really thank you from the deap of my small heart

ur so helpful

thank you too much

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

just any suggestions to make the if statements work as they are allocated with $block_data

for example

<vb:if condition="$block_data['albumbits2']">

Lynne 06-16-2013 04:44 PM

You would need to set that variable first:

$this->block_data['albumbits2'] = $albumbits2;

Honourable 06-16-2013 04:50 PM

did it erlier when it wasnt working

seems to me I'm not that bad though or maybe Lynne is a good teacher dont know

Thank You Again

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

sorrrry

it is not working I did it now???

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

I did this is not working

PHP Code:

        $this->block_data['albumbits2'] = $albumbits2;

vB_Template::preRegister('memberinfo_block_photos', array('block_data' => $block_data)); 

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

I did this

still not working

PHP Code:

        $this->block_data['albumbits2'] = $albumbits2;

vB_Template::preRegister('memberinfo_block_photos', array('albumcount' => $albumcount));
vB_Template::preRegister('memberinfo_block_photos', array('albumbits2' => $albumbits2));
vB_Template::preRegister('memberinfo_block_photos', array('block_data' => $block_data));    
vB_Template::preRegister('memberinfo_block_photos', array('block_data['albumbits2']' => $block_data['albumbits2']));

vB_Template::preRegister('memberinfo_block_photos', array('block_data.albumbits2' => $block_data.albumbits2.)); 


Lynne 06-17-2013 03:39 AM

What exactly isn't working - the whole page?

Honourable 06-17-2013 05:05 PM

no the if statement everything working yet the if statements as well as the count variable I have registered it yet is not working

waiting for your solution

many thanks in advance

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

Hey Lynne,

It retrieves the albums yet if I add the if statements
and set the variable of data_block

as you said

Quote:

You would need to set that variable first:

$this->block_data['albumbits2'] = $albumbits2;
add the above code in php as i attached in the privous post

the if statement is not working once I add it around the albums and buttons

it displays that there is no album

the template as follow

PHP Code:

<div id="view-photos" class="<vb:if condition="$selected_tab == 'photos'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>">
    <
div class="blocksubhead subsectionhead userprof_headers userprof_headers_border">     
        <
h4 class="subsectionhead-understate">User albums</h4>
    </
div>

<
div class="albums">
    <
h5 class="blocksubhead smaller">
        <
class="textcontrol" href="album.php?{vb:raw session.sessionurl}do=addalbum">{vb:rawphrase add_album}</a>
        <
span class="albums_total">{vb:raw albumcount}</span> {vb:rawphrase albums}
    </
h5>
    <
div class="blockbody userprof_content userprof_content_border">
        <
vb:if condition="$block_data['albumbits2']">
        <
ul class="albumslist blockrow image_link_list">
            {
vb:raw albumbits2}
        </
ul>
        <
vb:else />
        <
div class="blockrow member_blockrow">
            {
vb:rawphrase you_have_not_created_any_albums}
        </
div>
        </
vb:if>
    </
div>
</
div>

</
div

you can see the if statements in this bet

PHP Code:

        <vb:if condition="$block_data['albumbits2']">
        <
ul class="albumslist blockrow image_link_list">
            {
vb:raw albumbits2}
        </
ul>
        <
vb:else />
        <
div class="blockrow member_blockrow">
            {
vb:rawphrase you_have_not_created_any_albums}
        </
div>
        </
vb:if> 

it goes to else which is there is no album when there is

I have tried all what you have suggested me

yet is not working??

Lynne 06-17-2013 06:20 PM

Why are you not using this:
<vb:if condition="$albumbits2">

instead of this:
<vb:if condition="$block_data['albumbits2']">

You know that $albumbits2 is defined and registered for use in that template, so why aren't you using it?

Honourable 06-18-2013 11:59 AM

then why I'm setting this

$this->block_data['albumbits2'] = $albumbits2;

?

I thought this is block data a permission array that holds permission for many things
one of them albumbits2????

am I thinking in the right direction??

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

also registered albumcount yet is not display as well as this variable is not display??
{vb:raw userinfo.userid}

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

trying randomly

tried this

vB_Template::preRegister('memberinfo_block_photos' , array('albumbits2' => $albumbits2));
vB_Template::preRegister('memberinfo_block_photos' , array('albumcount' => $albumcount));
vB_Template::preRegister('memberinfo_block_photos' , array('userinfo' => $userinfo));
vB_Template::preRegister('memberinfo_block_photos' , array('albums' => $albums));

Lynne 06-18-2013 05:00 PM

And what code did you add to your plugin to get the album count or userinfo - I don't see any code there to define those. And, $albums is not something you can use - it is the query, so it's just a pointer really.

As for why you are trying to use $block_data['albumbits2'], I don't know. If you are just trying to only add code if $albumbits2 exists, then I would use that variable.

Honourable 06-19-2013 11:55 AM

Ok can you tell me how to display the album counts???


All times are GMT. The time now is 08:08 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.02408 seconds
  • Memory Usage 1,775KB
  • 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
  • (2)bbcode_html_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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