I've been tweaking my own toplist and, it all seems to be working swell. I am using the links table to generate random images from user albums. Here's the one issue I'm having:
There are certain rows that do not link to an image. I'm assuming that this is because the user deleted the image but, the row remains in the table. The problem with this is these rows still get chosen in my toplist, here's the code:
a) structure the code to only display rows with image links? b) run a scheduled maintainance on the table to remove rows without links?
Oh, one more question to avoid multiple posts. I want to call random images (ala a toplist) on other pages within my site BUT outside of the gallery. Is there a way to do this? These other pages are .php pages (just created long before the gallery was implemented).
What version is this? Deleted items could remain in the table in 2.2, but not before, and in 2.2 they shouldn't show up in toplists.
To use toplists outside the script see the javascript export, or you can adapt the 'custom template anywhere' hack into your php file if you can handle it.
It's strange, I wonder if they could be failed uploads or something. I deleted several blank 'links' rows yesterday but, I'm thinking that might not be a good idea since the other tables might be trying to call those rows (even though they don't contain an image link).
Another 2 rows just happened today. Looking them over, there's no information in the row at all, except for catid, IP, etc of the submitter. Very strange. Ever had this happen?
BTW- I got the custom template hack working (I was worried reading over that one poster's difficulties). Is there a big/noticable savings on the server load time doing it this way vs. the javascript export method, in your experience?
The javascript export has to load two pages into a third page (it grabs the toplist page from the exporter php page in 2.15, though this is compressed to once step in 2.2) so it is noticably harder on the server than a simple php page toplist.
I can't say I've ever seen blank rows. Sounds like maybe failed aliases of some sort... maybe attempts at adding an image from elsewhere in the gallery to somebody's album.
That's not good to hear; I like having common problems with answers I should already know. I noticed that they all have the correct IP for the CATID (checked the other corrosponding 'links' rows) so, it seems like the album owner was trying to submit something.
Do you think it's safe to delete these rows or, will they still count against the total image number I've set for each member (and cause problems with rows that should be there and aren't)?
Also, is there any way to run a quick cronjob-like check on the links tables (and delete rows with no image links)?
That's their main email address from my prexisting database (it's in the integration file).
That's not good news but, kinda what I was expecting. Can you tell me if it's possible to set up an automated cronjob-type check and removal of blank rows? I'll figure out how to do it, if it is (have to dust off the mysql book on my coffee table). I can't say that I've ever heard of wether that's possible or not.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on removing blank 'links' rows
Experienced
Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Comments: 83
I've been tweaking my own toplist and, it all seems to be working swell. I am using the links table to generate random images from user albums. Here's the one issue I'm having:
There are certain rows that do not link to an image. I'm assuming that this is because the user deleted the image but, the row remains in the table. The problem with this is these rows still get chosen in my toplist, here's the code:
<CONFIG>links,rand(),2,ascending,,,,1,0,1,0</CONFIG>
Is there a way I can either:
a) structure the code to only display rows with image links?
b) run a scheduled maintainance on the table to remove rows without links?
Oh, one more question to avoid multiple posts. I want to call random images (ala a toplist) on other pages within my site BUT outside of the gallery. Is there a way to do this? These other pages are .php pages (just created long before the gallery was implemented).
Thanks, Paul!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
What version is this? Deleted items could remain in the table in 2.2, but not before, and in 2.2 they shouldn't show up in toplists.
To use toplists outside the script see the javascript export, or you can adapt the 'custom template anywhere' hack into your php file if you can handle it.
Experienced
Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Comments: 83
I'm using 2.15.
It's strange, I wonder if they could be failed uploads or something. I deleted several blank 'links' rows yesterday but, I'm thinking that might not be a good idea since the other tables might be trying to call those rows (even though they don't contain an image link).
Another 2 rows just happened today. Looking them over, there's no information in the row at all, except for catid, IP, etc of the submitter. Very strange. Ever had this happen?
BTW- I got the custom template hack working (I was worried reading over that one poster's difficulties). Is there a big/noticable savings on the server load time doing it this way vs. the javascript export method, in your experience?
THANKS!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
The javascript export has to load two pages into a third page (it grabs the toplist page from the exporter php page in 2.15, though this is compressed to once step in 2.2) so it is noticably harder on the server than a simple php page toplist.
I can't say I've ever seen blank rows. Sounds like maybe failed aliases of some sort... maybe attempts at adding an image from elsewhere in the gallery to somebody's album.
Experienced
Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Comments: 83
That's not good to hear; I like having common problems with answers I should already know. I noticed that they all have the correct IP for the CATID (checked the other corrosponding 'links' rows) so, it seems like the album owner was trying to submit something.
Do you think it's safe to delete these rows or, will they still count against the total image number I've set for each member (and cause problems with rows that should be there and aren't)?
Also, is there any way to run a quick cronjob-like check on the links tables (and delete rows with no image links)?
Thanks, Paul!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It's safe to delete them since they're not doing anything. A screenshot of your phpmyadmin might give me an idea though.
Experienced
Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Comments: 83
I sent some on over, can you make anything out from them?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Where does "pirmary_email" come from? Other than that I don't see any hints in it.
Experienced
Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Comments: 83
That's their main email address from my prexisting database (it's in the integration file).
That's not good news but, kinda what I was expecting. Can you tell me if it's possible to set up an automated cronjob-type check and removal of blank rows? I'll figure out how to do it, if it is (have to dust off the mysql book on my coffee table). I can't say that I've ever heard of wether that's possible or not.