|
#11
|
|||
|
|||
|
Dang.. must get more sleep ;-)
Thanks, I've got it. It works. |
|
#12
|
||||
|
||||
|
oups didn't read the complete tread I found the answer to my question that was with line for version 1.7.1... sorry
__________________
My help is always free, but if you want to donate or to buy me a coffee cup, then click here Last edited by fredxeric; 03-02-2008 at 09:10 PM. |
|
#13
|
||||
|
||||
|
Here's a random front page image that does not require any hacking...
http://www.pixelpost.org/extend/addo...nt-page-image/ |
|
#14
|
|||
|
|||
|
Kevin - I think I've been able to misinterpret your simply instruction to put <RANDOMFRONT> into the first line of image_template.html. Do you mean the literal first line:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> or some other? I get either a 404 or no randomization depending on where I insert it. The 404 clears when I turn off Randomization in admin panel. Will you be kind enough to reply with a line that has the tag correctly inserted? Thanks! Alan |
|
#15
|
|||
|
|||
|
I'm following up on my last post with some lessons learned en route to getting random images on the opening page to work correctly. I found the original 08-27-2007 post by iaredatsun that had a 1-line index.php hack that worked perfectly for me in 1.7.1. The full text is below to save you looking around, but I modified line 428 instead of 333. To find the line, I searched index.php for the string
$row = sql_array("SELECT * FROM and replaced the first occurrence of the entire row containing that partial statement with $row = sql_array("SELECT * FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$cdate' ORDER BY rand() asc limit 0,1"); FWIW, I use a customized badarrow template, Ajax Categories Manager, External App Upload (for LR) and ImageCycle. All coexist happily with this hack. I saw it in the thread and got the same results in that randomization does not work while I'm logged in as admin, but starts immediately after I log out. I'm happy with that and am not going to look for the line that is called when I'm logged in. Thanks iaredatsun! ****Original Post Text*** Old 08-27-2007, 05:20 AM iaredatsun Offline forum loafer Join Date: Aug 2007 Posts: 6 A simple random front page image hack Problem: showing a random picture each time the home page is first loaded. (Of course this should not effect the loading of images from the browse page.) I know this has been discussed before but no one seemed to come up with a satisfactory answer to this functionality. Usually people suggested some modification of the site structure with index2.php and random folder image method. My method is a simple one line modification to the index.php file line 333 of orginal index.php - change: $row = sql_array("SELECT * FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$cdate' ORDER BY datetime DESC limit 0,1"); to: $row = sql_array("SELECT * FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$cdate' ORDER BY rand() asc limit 0,1"); This will only effect the page when it loaded with no PHP arguments - i.e. only when someone first goes to the site and not when things are accessed from the thumbnails page. Please note that I think this will only work if you are not logged in as admin. I think modifying that would be simple too. I'm totally new to this but I have tested this a few times and it seems to work fine - at least for me. Any comments? Mr.Datsun |
| Post Reply |
| Thread Tools | |
|
|