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

Reply
 
Thread Tools Display Modes
  #11  
Old 12-31-2009, 08:20 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But why is it all meshd up? And on the first load the plugin is displayed below the About plugin.
Reply With Quote
  #12  
Old 12-31-2009, 11:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Probably because your template is not using the correct css classes. If you look at your page source, the stuff that is 'showing' is class=selected_view_section, if it isn't showing (the tab isn't selected), it is class=view_section. You need to write a condition at the top of your template to define which class is used in your div (<vb:if condition="$selected_tab == 'mymodification'"> class="selected_view_section"<vb:else />class="view_section"</vb:if>)
Reply With Quote
  #13  
Old 01-01-2010, 05:20 AM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that's correct, mymodification has the class Block, all the other have view_section and one has selected_view_section.

that isn't going to work, i had to try that before.

look below for what is outputed:

i have trying a lot but i can't get i to work.





PHP Code:
<div id="view-aboutme" class="selected_view_section">
<
h3 class="subsectionhead">
</
h3>
<
h4 id="about-me" class="subsectionhead-understate">Basic Information</h4>
<
div class="subsection">
</
div>
<
h4 class="subsectionhead-understate">Handtekening</h4>
<
div class="subsection">\n Computers make very fas... very accurate mistakes.\n</div>
<
h4 id="contact-info" class="subsectionhead-understate">Contact</h4>
<
div class="subsection">
</
div>
<
h4 id="view-statistics" class="subsectionhead-understate">Statistieken</h4>
<
div class="subsection">
</
div>
</
div>
<
div id="view-friends-content" class="view_section">
<
h3 id="friends" class="subsectionhead">
</
h3>
<
div>
</
div>
</
div>
<
div id="view-infractions-content" class="view_section">\\</div>
<
div id="view-mymodification" class="block">
<
div class="view_section">\n\n$block_data[mymodification]\n\n</div>
</
div>
<
div class="underblock"/> 
Reply With Quote
  #14  
Old 01-01-2010, 02:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand what you are printing out there - that shouldn't be your template, so what is it?
Reply With Quote
  #15  
Old 01-01-2010, 03:58 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that is the code what my members page give after rendering, and after inserting the code you gave in post 12.

at the bottom of the code you coulld see what it gave as output. and that is not what my plugin should give.


i put the code just before the hook location at the bottom of the members template.

[edit] code added

plugin code, hook location: members_hook_location_start
PHP Code:
$maxcolum 4;
$maxrow 4;
$maxwidth 200;
$maxheight 200;
$page $vbulletin->input->clean_gpc('r''page'TYPE_INT);


$blocklist array_merge($blocklist, array(
    
'mymodification' => array(
        
'class' => 'mymodification',
        
'title' => 'Bijlagen',
        
'hook_location' => 'profile_left_last'
        
)
      ));

class 
vB_ProfileBlock_MyModification extends vB_ProfileBlock
{
    
    var 
$template_name 'memberinfo_block_mymodification';

    function 
confirm_empty_wrap()
    {
        return 
true;
    }

    function 
confirm_display()
    {
        return (
$this->block_data['mymodification'] != '');
    }

    function 
prepare_output($id ''$options = array())
    {
        global 
$maxcolum$maxrow$maxwidth$maxheight$vbulletin$page;

        
$colum 0;
        
$forumidsnull;
                
        
$perpage $maxcolum $maxrow;
            
        foreach (
$vbulletin->userinfo['forumpermissions'] AS $vbulletin->foruminfo[forumid] => $perm)
        {
            if ((
$perm $vbulletin->bf_ugp_forumpermissions['canview']))
            {
                
$forumids .= ','.$vbulletin->foruminfo[forumid];
            }
        }    
      
        
$attachments $vbulletin->db->query_read("
            SELECT attachment.attachmentid, attachment.contentid, attachment.userid, post.postid, post.threadid, post.visible,thread.forumid,
            thread.title, thread.open
            FROM vb3_attachment as attachment 
            LEFT JOIN vb3_post AS post ON (post.postid = attachment.contentid)
            LEFT JOIN vb3_thread as thread on(post.threadid = thread.threadid)
            LEFT JOIN vb3_deletionlog AS deletionlog ON(attachment.contentid = deletionlog.primaryid AND type = 'post')
            WHERE attachment.userid = "
.$this->profile->userinfo['userid']. "
            AND (
            thread.forumid IN(0
$forumids)
            AND thread.visible = 1 
            AND post.visible = 1 
            AND deletionlog.primaryid IS NULL)"
);
        
$totalattachments $vbulletin->db->num_rows($attachments);            
      

        
$totalpages ceil($totalattachments / ($perpage));
        
$perpage $maxcolum $maxrow;
        
        
$vbulletin->input->clean_array_gpc('r', array(
            
'perpage'    => TYPE_UINT,
            
'pagenumber' => TYPE_UINT,
            ));  
      
        

        
$attachments $vbulletin->db->query_read("
            SELECT attachment.attachmentid, attachment.contentid, attachment.userid, post.postid, post.threadid, post.visible,thread.forumid,
            thread.title, thread.open
            FROM vb3_attachment as attachment 
            LEFT JOIN vb3_post AS post ON (post.postid = attachment.contentid)
            LEFT JOIN vb3_thread as thread on(post.threadid = thread.threadid)
            LEFT JOIN vb3_deletionlog AS deletionlog ON(attachment.contentid = deletionlog.primaryid AND type = 'post')
            WHERE attachment.userid = "
.$this->profile->userinfo['userid']. "
            AND (
            thread.forumid IN(0
$forumids)
            AND thread.visible = 1 
            AND post.visible = 1 
            AND deletionlog.primaryid IS NULL) limit "
.($page*$perpage). ",". (($page+1)*$perpage));      
      
        
      
      
        
$output "";
        
$output .= "<br>Totaal aantal bijlagen ".$totalattachments"<br>Huidige pagina : "$curentpage" van "$totalpages"
                    URL page : "
.$page."<br>
                    <table border=1>"
;
        
         
        while (
$post mysql_fetch_array($attachments))
        {
            if (
$colum == 0) {$output .= "<TR>";}
        
            
$output .= "<td width=".$maxwidth." height=".$maxheight."><a target=blank href=attachment.php?attachmentid=".$post['attachmentid']."/>
                        <img border=0 src=attachment.php?attachmentid="
.$post['attachmentid']."&thumb=1 width=100% height=100%/>
                        </a></td>" 
;
        
            
$colum $colum 1;

            if (
$colum == $maxcolum){ 
                
$colum 0
                echo 
"</tr>";
                }
        }
        
$output .= "</table>";
        
$this->block_data['mymodification'] = $output;
    }



Template : memberinfo_block_mymodification

PHP Code:
<vb:if condition="$selected_tab == 'mymodification'"> class="selected_view_section"<vb:else />class="view_section"</vb:if>
$block_data[mymodification
Template : last peace of MEMBERINFO

PHP Code:
        <div id="view-aboutme" class="<vb:if condition="$selected_tab == 'aboutme'">selected_view_section<vb:elseif condition="$selected_tab == '' AND !$show['post_visitor_message']" />selected_view_section<vb:else />view_section</vb:if>">
                {
vb:raw blocks.aboutme}
            </
div>
            <
div id="view-friends-content" class="<vb:if condition="$selected_tab == 'friends'">selected_view_section<vb:else />view_section</vb:if>">
                {
vb:raw blocks.friends}
            </
div>
            <
div id="view-infractions-content" class="<vb:if condition="$selected_tab == 'infractions'">selected_view_section<vb:else />view_section</vb:if>">
                {
vb:raw blocks.infractions}
            </
div>
            
{
vb:raw template_hook.profile_left}
        </
div>
    </
div>
</
div>

{
vb:raw footer}
</
body>
</
html
Reply With Quote
  #16  
Old 01-01-2010, 05:22 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code I posted was not complete code. It was code you will need to use in your custom template that you need to create for your tab. The article tells you to create a template. You CANNOT use the code she posted since it is vb3 template code. What does your template look like (you should look at other tabs and see what code is needed) and what is it called (it should be called memberinfo_block_mymodification)
Reply With Quote
  #17  
Old 01-01-2010, 05:53 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

my template says

PHP Code:
<div id="view-mymodification" class="<vb:if condition="$selected_tab == 'mymodification'">selected_view_section<vb:else />view_section</vb:if>">
{
$block_data[mymodification]}
</
div
this is almost working, only i get now on my life test site 2 lines with div id= "....." when i change the tab only the first div is changed into class="view_section_selected"


PHP Code:
<div id="view-mymodification" class="block">
<
div id="view-mymodification" class="view_section">\nContent to show in the tab.\n</div>
</
div
the plugin is default from the article

when i look at, memberinfo_block_aboutme, there is only html code and some vb stuff not rellated to this problem.

i realy don't know.

maybe it would help if i could find the hook location is a template, but when i search the templates it comes up with no hits.

maybe it's me, that i'm a beginner. so when it's to much trouble leave it and close this treaht. i'm stuck on this for 4 days now, i becom a bit crazy

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

lynne,maybe you have a peace of working plugin and template, so i could see how you did it?
Reply With Quote
  #18  
Old 01-01-2010, 07:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You aren't putting 'names' above any of your template code so I can't tell what templates you are posting (nor can I tell why you have two - you should only have one, I would think).

I didnt' really want to post my template because it is on my RC4 site - I haven't upgraded that particular test site to Gold yet. However, here is mine which will hopefully work on gold.

template name - memberinfo_block_mytorrentstats
PHP Code:
<div id="view-{vb:raw id}" <vb:if condition="$selected_tab == 'mytorrentstats'"> class="selected_view_section"<vb:else />class="view_section"</vb:if>>
<
h3 class="subsectionhead">Torrent Stats</h3>
        {
vb:raw block_data.mytorrentstats}
</
div>
<
div class="underblock"></div>
<!-- / {
vb:raw id} --> 
Reply With Quote
  #19  
Old 01-01-2010, 08:08 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and your plugin looks like what i have except for what it's given back. but building the block and giving back it's content.

the template name where i speake about is memberinfo_block_mymodification

block_data.mytorrentstats is what you get back from your plugin ?
Reply With Quote
  #20  
Old 01-01-2010, 08:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ours are similar. One mistake you are making in yours is that you are not allowed to use the same id twice on a page. You are. I don't know if that is causing the problem, but it always helps to get rid of any html/css errors to eliminate those as the culprit.
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:17 AM.


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.04212 seconds
  • Memory Usage 2,345KB
  • 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
  • (7)bbcode_php
  • (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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete