Log in

View Full Version : Wrong album picture count - where is the album picture count stored?


jerx
10-09-2008, 01:22 PM
I have imported many pictures from another mod to vb' s album. Unfortunately the album picture count is not correct, if a user has more than 1 picture. Eg "Picture 3 of 1 from Album AlbumName" (View Picture page).

I was not able to find the album count. I think that these are the only tables which are important for the pictures:

album
albumpicture
picture

picturecomment and picturecommenthash should be unimportant.

Or isn' t it stored in the database? How is the album picture count generated?

The template uses this to generate the text:
<phrase 1="$pic_location[pic_position]" 2="$albuminfo[picturecount]" 3="$albuminfo[title]">$vbphrase[picture_x_of_y_from_album_z]</phrase>

I think it might have been calculated incorrectly, because I had wrong values for creation date and last picture update for the album. Now I have correct values, but the problem persists. I have also tried to update the counters by setting a new max for the allowed picture quantity, but still no luck.

Can anybody please help me on this issue?

Marco van Herwaarden
10-11-2008, 10:24 AM
How did you import them?

jerx
10-13-2008, 01:02 PM
I imported the pictures manually by adjusting the old database table to suit vbulletins scheme. In the end I had generated three tables: vb_album, vb_albumpicture, vb_picture.

On a different thread concerning another import question (regarding picture comment hashs) you suggested using the datamanager. At that time I already imported the pictures. But it looked too complicated for me to use the datamanager. I only found the last two articles and I wasn' t able to understand their meaning.

Using the vBulletin Database Class (https://vborg.vbsupport.ru/showthread.php?t=119350&highlight=datamanager)
Creating Custom Datamanagers (https://vborg.vbsupport.ru/showthread.php?t=119376)
Datamanagers: Objects as Data and Methods (https://vborg.vbsupport.ru/showthread.php?t=174090&highlight=datamanager)

Now I have read the first article. Although I was able to understand more than I did when reading the other articles, I have the impression that you need more knowledge about php and mysql. Since I know very little about it, it might be very difficult to adapt the articles to my import issues.

Marco van Herwaarden
10-14-2008, 08:47 AM
The datamanagers would already take care of things like updating counters. As you manually inserted rows, you will need to update counters etc yourself, you also might be missing information. I suggest you start by asking at vB.com.

jerx
10-15-2008, 07:55 AM
I figured out why the counters have been wrong. I thought that the visible column in album table is for setting the visibility of an album, but it is the counter for the visible pictures. I corrected that column and the counter is displayed correctly now.

By the way, you won' t get any help at vb.com if you need information on non default features. Even if you only ask for help on understanding the default code, you will only be pointed to vb.org.