PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old December 4th, 2008, 02:05 AM   #1 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
Last upload image title doesn't update on index [low priority]

this is a low priority bug.. i stumbled into it when testing editimage on a fresh install.

Actually its not a bug.. but as vbgallery is designed (its simply missing)

to reproduce:

Look at gallery homepage or any parent category page:
You have(example) in table Last Upload:
Image title
by Luciano
12-02-2008 09:20 AM


that is correct!

But if you go to that image.. then you edit that image.. AND change the title.. the NEW TITLE is displayed correctly in showimage ..
BUT it is NOT UPDATED in the category's lastimagetitle field..

so on the mainpage you still will have the OLD title untill a new image is uploaded.

imho there should be something like this in editimage right after the update query:
Code:
Content visible to verified customers only.
Actually as no-one seen it before, its low priority and i think it would be enough if michael included it in new release..

Luc

Last edited by Luciano; December 4th, 2008 at 02:11 AM.
Luciano is offline   Reply With Quote
Old December 4th, 2008, 09:55 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
Actually possibly maybe a cache thing also but would need to look more to comment on that.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 4th, 2008, 05:05 PM   #3 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
Well for me it didnt.. checked all cached stuff..
the problem is users usually only edit the title right after upload..
so it can happen quite often..

i'm just testing a fix.. maybe you could test it also.. because I never use category 3 level only have level 1 and 2 installed.. AND I never use member categories.
Just added a 3rd level and it works.. but who knows.

ok.. here we go:
2 changes in editimage:
first the query:
added the images.title
AND
added a left join categories.. but with lastimageid=imageid
so we only get lastimagetitle and parentlist IF image is last image...

in editimage find:
Code:
Content visible to verified customers only.
replace with:
Code:
Content visible to verified customers only.
then, a bit lower after the normal update we add our update:
find:
Code:
Content visible to verified customers only.
and above add:
Code:
Content visible to verified customers only.
thats it.

Luc

PS: we should sooner or later replace all the addslashes(htmlspecialchars($image['title'])) with $db->escape_string(htmlspecialchars_uni($image['title']))
which I think is more appropriate and vbulletin standard.

I did it on a testinstall for all title and description database operations and it works fine with many special characters...

Last edited by Luciano; December 7th, 2008 at 07:36 AM. Reason: CODE UPDATED
Luciano is offline   Reply With Quote
Old December 4th, 2008, 08:09 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
I will try it out.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 5th, 2008, 12:41 AM   #5 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
oops...
ATTENTION: edited the code above.. (both.. code and query) it did NOT update when lastimagetitle was empty..

Last edited by Luciano; December 5th, 2008 at 01:45 AM.
Luciano is offline   Reply With Quote
Old December 5th, 2008, 10:36 AM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
That code works fine
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 6th, 2008, 03:54 AM   #7 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
Thanx... just seen something else
there also is a lastimagetitle ALSO in ppgal_user which is NOT updated in imageedit

so if you upload an image with blank title.. then edit title... in profile or whereever lastimagetitle is needed .. it will be empty (or the filename)


I will see if i can add this to the editimage fix..

Luc
Luciano is offline   Reply With Quote
Old December 6th, 2008, 09:59 AM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
yeah not critical things here but good to fix cosmetic things. I have sent anything I have fixed to Michael for inclusion in the new beta as well as updated the current build.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 7th, 2008, 06:03 AM   #9 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
OK Chuck, updated the code above in the post:

added a left join for table ppgal_user so the lastimageid and lastimagetitle can be fetched..

IF the lastimageid == the edited imageid AND the 2 titles are not the same.. then it also updates the ppgal_user table's lastimageititle..

---
I also added a if ($imageinfo['catid'] == $image['catid']) to the code.. because now the lastimage for the category is only done when the user did only changed the title!!!! If he also changed the category (at the same time which he can) then the work with the titles (remove from old category.. pass to new etc..) is done in the update_count function that is called below.

Luc

probably the code can be shortened.. but I think editimage is not high traffic and it is clearer like this..

Last edited by Luciano; December 7th, 2008 at 06:25 AM.
Luciano is offline   Reply With Quote
Old December 7th, 2008, 08:36 AM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
yeah I will see if I can clean it up.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 16th, 2008, 12:29 PM   #11 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
Quote:
Originally Posted by Chuck S View Post
yeah I will see if I can clean it up.
Well it works.. but.. it is more complex
if you have setup like follows:

maincat
-----subcat1
------------subcat2
-----subcat3

and you edit title in subcat 2... for image uploaded yesterday..
BUT in subcat3 someone uploaded image this morning.. then his title should appear on mainpage..
my new title should only appear on subcat 2 and subcat 1

his title should remain lasttitle for subcat3 and maincat..

But my fix will update subcat2 + subcat 1 AND maincat.. (but maincat should be left as is..)

I'm not quite shure how to do this.. without checking all last imageid in parentlist..

Luc
Luciano is offline   Reply With Quote
Old December 16th, 2008, 12:32 PM   #12 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,698
yeah well would have to think about that one
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 16th, 2008, 02:22 PM   #13 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
well i think i found something thats easy...

instead of
Code:
Content visible to verified customers only.
just use
Code:
Content visible to verified customers only.
we just update the last image title in all cats that have the imageid as lastimageid..

I think it takes less reasources and less queries.. and should work..

Luc

Last edited by Luciano; December 16th, 2008 at 02:49 PM.
Luciano is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recent Comments doesnt update in the index.. auto_freak Photopost Pro Bug Reports 10 October 23rd, 2008 06:24 AM
Very low quality thumbs...... scarab23 Photopost Pro How Do I...? 1 August 15th, 2008 05:50 PM
<title>Site Name - Main Index</title> blankoboy Classifieds How do I...? 8 May 19th, 2008 10:42 AM
VbGallery - Low Priority? 0ptima General Discussion 4 April 22nd, 2006 12:08 PM
PP521: How to hide image title and author on index page snoopy5 Photopost Pro How Do I...? 11 April 17th, 2006 11:42 AM


All times are GMT -5. The time now is 03:24 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0