Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-12-2007, 11:49 PM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default stumped on yucky parse error

I have to call multiple instances of the postbit_attachmentthumbnail template from within the adminCP (crazy, i know)

I am calling it like this:

PHP Code:
while ($attachment $db->fetch_array($attachments))
{
    
// ... display each thumbnail
    
$thumbs .= "
        <a href=\"attachment.php?"
.$session['sessionurl']."attachmentid=".$attachment['attachmentid']."&amp;d=".$attachment['dateline']."\" target=\"_blank\">
        <img class=\"thumbnail\" 
            src=\"attachment.php?"
.$session['sessionurl']."attachmentid=".$attachment['attachmentid']."&amp;stc=1&amp;thumb=1&amp;d=".$attachment['thumbnail_dateline']."\" 
            border=\"0\" 
            alt=\"
            <phrase 
                1=\""
.$attachment['filename']."\" 
                2=\""
.$attachment['counter']."\" 
                3=\""
.$attachment['filesize']."\" 
                4=\""
.$attachment['attachmentid']."\"
            > 
                "
.$vbphrase['image_larger_version_x_y_z']."
            </phrase>
            \"
         />
        </a>
        &nbsp;"
.iif($show['br'], "<br /><br />")."
    "
;
}
print_description_row($thumbs06'''center'); 
however i'm not getting the results i need ( see attached "yucky.gif" )

It's something to do with closing the image tag i'm pretty sure. I've been on this for 3 hours now and starting to get brainfry or brainfart.
Attached Images
File Type: gif yucky.gif (10.7 KB, 0 views)
Reply With Quote
  #2  
Old 08-13-2007, 12:14 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a thought...close the img tag.

Here's another, do this with the template system, thats what it is there for.
Reply With Quote
  #3  
Old 08-13-2007, 12:17 AM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Isn't the following bit in red closing the img tag"

</phrase>
\"
/>
</a>
&nbsp;".iif($show['br'], "<br /><br />")."

If i'm not mistaken the <phrase> things might be an issue as well, that seems to be some sort of javascript tag which creates the hover text in the alt tag. I don't however know where this is defined and am guessing it's not defined within the admincp.

I didn't think I could eval templates from within the adminCP. I've never seen that done before in any of jelsoft's admin scripts. (or am i just totally fried???)
Reply With Quote
  #4  
Old 08-13-2007, 06:22 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Admin scripts usualy do not use the template system (to avoid getting locked out of admincp if there is an error in templates!).

Look at the source of the output page to find your error.
Reply With Quote
  #5  
Old 08-13-2007, 08:52 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't forget <phrase> tags aren't standard HTML duh
Reply With Quote
  #6  
Old 08-13-2007, 10:44 AM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I finally gave up on hving the phrase tags included, and once removed, I'm no longer getting the errors, so thanks for the help people
Reply With Quote
  #7  
Old 08-13-2007, 10:58 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the construct_phrase() function see if that works?
Reply With Quote
  #8  
Old 08-14-2007, 03:31 AM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that function didn't work for me, i think because the <phrase> tag has something to do with javascript, which I am clueless about. Thanks for suggestion though
Reply With Quote
  #9  
Old 08-14-2007, 04:32 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<phrase> is not valid HTML

BTW, since you aren't parsing values in your double quotes, switch to single! It will make it so much cleaner to read because you don't have to escape all the HTML attribute quotes.
Reply With Quote
  #10  
Old 08-20-2007, 08:19 PM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh, good point thanks Sir.
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 03:45 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.04694 seconds
  • Memory Usage 2,275KB
  • 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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete