vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Social Group and Album Enhancements - All Albums (https://vborg.vbsupport.ru/showthread.php?t=172215)

TrIn@dOr 07-03-2008 02:44 PM

Perhaps "$vbphrase[pictures]" is not defined in phrases section?

Thanks in advance.

ProtoPC 07-03-2008 07:31 PM

Quote:

Originally Posted by TrIn@dOr (Post 1565868)
Perhaps "$vbphrase[pictures]" is not defined in phrases section?

Thanks in advance.

Not sure if this reply was for me...but my Pictures phrase variable and definition is listed in Phrases.

I would love it to have emtpy albums to not show...somehow.

Here is a link to it.

CPB123 07-03-2008 08:26 PM

Quote:

Originally Posted by ProtoPC (Post 1562706)
Where exactly in the two Select statements?...I added it at the end on both and got an error, ie:

$albumcount = $db->query_first("
SELECT COUNT(*) AS total
FROM " . TABLE_PREFIX . "album
WHERE state IN ('" . implode("', '", $state) . "')
AND album.visible > 0
");

I don't think you add that line to the end of the second SELECT statement (you do the first however, and it seems you have correctly done it based on your posted example) - here's how I did mine, on the first SELECT statement I did it just like yours, on the next one I added it right after the WHERE line and before the ORDER line as this made the most sense to me and lo and behold it worked on the first try. See if this helps:

SELECT album.*,
picture.pictureid, picture.extension, picture.idhash,
picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height,
user.*
FROM " . TABLE_PREFIX . "album AS album
LEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (album.userid = user.userid)
WHERE album.state IN ('" . implode("', '", $state) . "')
AND album.visible > 0
ORDER BY $sortname $sortorder
LIMIT $start, $perpage
");

ProtoPC 07-04-2008 12:31 AM

I still get the error:

MySQL Error : Unknown column 'album.visible' in 'where clause'

CPB123 07-04-2008 12:54 AM

Is that the same error you had before? I'm using this mod on 3.7.2 and the album.visible hack worked just fine, its just another condition thrown into the query. Are you able to access your forum database and see if there is a column called 'visible' in your table named 'album'?

ProtoPC 07-04-2008 06:05 AM

in table vb_album there is a column named visible.

All Columns:
albumid userid createdate lastpicturedate visible moderation title description state coverpictureid

Error Message emailed to me:

Invalid SQL:

SELECT COUNT(*) AS total
FROM vb_album
WHERE state IN ('public', 'private', 'profile')
AND album.visible > 0;

MySQL Error : Unknown column 'album.visible' in 'where clause'
Error Number : 1054

--------------------Added to---------------

$albumcount = $db->query_first("
SELECT COUNT(*) AS total
FROM " . TABLE_PREFIX . "album
WHERE state IN ('" . implode("', '", $state) . "')
AND album.visible > 0
");

------------And--------------

$albums = $db->query_read("
SELECT album.*,
picture.pictureid, picture.extension, picture.idhash,
picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height,
user.*
FROM " . TABLE_PREFIX . "album AS album
LEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (album.userid = user.userid)
WHERE album.state IN ('" . implode("', '", $state) . "')
AND album.visible > 0
ORDER BY $sortname $sortorder
LIMIT $start, $perpage
");

CPB123 07-04-2008 10:48 AM

Okay I think you're getting closer - since you have a table prefix of vb_ try this

$albumcount = $db->query_first("
SELECT COUNT(*) AS total
FROM " . TABLE_PREFIX . "album
WHERE state IN ('" . implode("', '", $state) . "')
AND vb_album.visible > 0
");

but leave the second SELECT statement as album.visible don't change that one to vb_album.visible and see what happens

ProtoPC 07-04-2008 05:16 PM

Quote:

Originally Posted by CPB123 (Post 1566625)
Okay I think you're getting closer - since you have a table prefix of vb_ try this

$albumcount = $db->query_first("
SELECT COUNT(*) AS total
FROM " . TABLE_PREFIX . "album
WHERE state IN ('" . implode("', '", $state) . "')
AND vb_album.visible > 0
");

but leave the second SELECT statement as album.visible don't change that one to vb_album.visible and see what happens

Thank you! That fixed it.

CPB123 07-05-2008 12:32 AM

woohoo! glad to help, ProtoPC. :)

Smiry Kin's 07-05-2008 06:26 PM

One of the most usful addons, altho this should have been default with vbulletin, go copyright it and make them pay you to use it. :)


All times are GMT. The time now is 12:37 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.02586 seconds
  • Memory Usage 1,746KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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