vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Problem with showing album link in postbit (https://vborg.vbsupport.ru/showthread.php?t=209334)

Mark.B 03-24-2009 08:38 PM

Problem with showing album link in postbit
 
I am using THIS mod to try and get a link to show in postbit/postbit legacy if a user has any albums. However, as written the mod does not work for me (3.8.1 PL1). The mod author is not about so I am trying to fix it myself.

The problem is that this conditional is always returning false:

Code:

if (!empty($post['hasalbum']))
So the code does not show up. I can remove the conditional and the code will show fine, but obviously for everyone, even if they have no album.

The sub query being used at hook location showthread_query is this:
Code:

$hook_query_fields .= ",album.userid as hasalbum";

$hook_query_joins .= "LEFT JOIN (SELECT state, userid, MAX(albumid) AS hasalbum FROM " . TABLE_PREFIX . "album GROUP BY userid) album ON(user.userid = album.userid AND album.state = 'public')";

I can't work out why this isn't working for me....looking at the thread it works for some and not others. What's wrong? What other conditional could I replace that conditional with to try and make it work?

Lynne 03-24-2009 09:08 PM

Try looking at your error_logs and seeing if there is something in there about the query.

Mark.B 03-24-2009 11:38 PM

Thanks Lynne, no, nothing at all in there.

Lynne 03-24-2009 11:48 PM

Where are you doing the condition? Are you sure the query is done before that plugin?

Mark.B 03-25-2009 12:31 AM

Quote:

Originally Posted by Lynne (Post 1776277)
Where are you doing the condition? Are you sure the query is done before that plugin?

I think so....it's showthread_query for the query, followed by postbit_display_start for the conditional.

Lynne 03-25-2009 02:52 AM

I believe in postbit_display_start you need to use $this->post, not $post.

Dismounted 03-25-2009 06:55 AM

Either will work, they are one and the same (by-ref).

Mark.B 03-25-2009 06:57 AM

Thanks...but still not working.

Got me baffled this...

Lynne 03-25-2009 03:04 PM

I just tested this on my test site and it works just fine. Are you sure you have an up-to-date postbit (or postbit_legacy) template that has the correct template_hook for it to show?

Mark.B 03-25-2009 05:37 PM

Thanks Lynne....Yes, definitely. I know this because I have removed the conditional so that the code shows up for everyone, and it's appearing ok.

There are others in the mod thread saying it isn't working for them....I wonder if it's one of those mods that only works under certain server configurations.


All times are GMT. The time now is 11:02 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.01274 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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