Page 2 of 9

Posted: Thu Oct 30, 2003 4:35 am
by JJSmallballer
For the one to edit how many posts it can be in, (bottom of your first post) you need a ; after that... you get a parse error if you don't!

Posted: Thu Oct 30, 2003 4:45 am
by JJSmallballer
I searched EVERY topic on my board (its relatively new) and I got NO picture... What does it look like, and where is it on the topic? Thanks!


I used that thing you had on the top for the number of posts it can be in... i have a thing that tells you the 5 last posts, so i set it to five... none. I posted a new topic, wasn't there...


http://www.smallballersunited.com/phpbb ... p?t=63#194
that is the only topic with a zero above the topic... what does that mean? is that supposed to be the picture?

Posted: Thu Oct 30, 2003 6:54 am
by pollix
Works good but I found one problem with mine.

When the page that the random image shows up on, it shows a number in the upper left hand corner. It is the number of the post on that page that contains the random image. For example: If you have 15 posts per page, and the random image is located in post number 12, then you will have a "12" located in the upper left corner right above where it would say "{your_title} Forum Index->{whatever_topic}"



EDIT: Ok.. I found out what went wrong. When you add the following to viewtopic.php

Code: Select all

//----Hidden Image Mod------
        $sql = "SELECT * FROM phpbb_image ORDER BY id DESC";
        if ( !($result = $db->sql_query($sql)) )
        {
                message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
        }

        $imgsrow = array();
        $imgsrow = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $random_img="";
                if($imgsrow['post_id'] == $postrow[$i]['post_id']){
                        echo $i;
                $temp_url = append_sid("randimage.$phpEx?user=".$userdata['user_id']."&post_id=".$postrow[$i]['post_id']);
                $random_img='<a href="' . $temp_url . '"><img src="' . $images['icon_random'] . '" alt="' . $total2 . '" title="' . $i . '" border="0" /></a>';
        }
//-----Hidden Image Mod------
I found out the echo $i was giving the problems. I commented out the $i and I don't have the problem anymore. I haven't found any problems with having this commented out either.

Posted: Thu Oct 30, 2003 11:38 am
by Acecool
Very interesting :-)

Posted: Thu Oct 30, 2003 4:05 pm
by JJSmallballer
pollix wrote: Works good but I found one problem with mine.

When the page that the random image shows up on, it shows a number in the upper left hand corner. It is the number of the post on that page that contains the random image. For example: If you have 15 posts per page, and the random image is located in post number 12, then you will have a "12" located in the upper left corner right above where it would say "{your_title} Forum Index->{whatever_topic}"



EDIT: Ok.. I found out what went wrong. When you add the following to viewtopic.php

Code: Select all

//----Hidden Image Mod------
        $sql = "SELECT * FROM phpbb_image ORDER BY id DESC";
        if ( !($result = $db->sql_query($sql)) )
        {
                message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
        }

        $imgsrow = array();
        $imgsrow = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $random_img="";
                if($imgsrow['post_id'] == $postrow[$i]['post_id']){
                        echo $i;
                $temp_url = append_sid("randimage.$phpEx?user=".$userdata['user_id']."&post_id=".$postrow[$i]['post_id']);
                $random_img='<a href="' . $temp_url . '"><img src="' . $images['icon_random'] . '" alt="' . $total2 . '" title="' . $i . '" border="0" /></a>';
        }
//-----Hidden Image Mod------
I found out the echo $i was giving the problems. I commented out the $i and I don't have the problem anymore. I haven't found any problems with having this commented out either.



I did that, I still get a zero, and no picture!

Posted: Thu Oct 30, 2003 4:51 pm
by brazaz
2JJSmallballer
Image
try this post on your board
http://www.smallballersunited.com/phpbb ... ?p=194#194
:wink:

2pollix thanks=) i was trying to find this echo ... but i couldn't, because it was in "Hidden Image Mod Install.txt" :oops:

Posted: Thu Oct 30, 2003 9:47 pm
by JJSmallballer
Got it! Great mod! Thanks!

Posted: Thu Oct 30, 2003 9:59 pm
by JJSmallballer
//----Hidden Image Mod------
$sql = "SELECT * FROM phpbb_image ORDER BY id DESC";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
}

$imgsrow = array();
$imgsrow = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$random_img="";
if($imgsrow['post_id'] == $postrow[$i]['post_id']){
echo $i;
$temp_url = append_sid("randimage.$phpEx?user=".$userdata['user_id']."&post_id=".$postrow[$i]['post_id']);
$random_img='<a href="' . $temp_url . '"><img src="' . $images['icon_random'] . '" alt="' . $total2 . '" title="' . $i . '" border="0" /></a>';
}
//-----Hidden Image Mod------


Do you mean that I take out ALL $i ?

Posted: Thu Oct 30, 2003 10:36 pm
by xmulder
Find...

Code: Select all

$sql = "SELECT * FROM phpbb_image ORDER BY id DESC"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql); 
} 

$imgsrow = array(); 
$imgsrow = $db->sql_fetchrow($result); 
$db->sql_freeresult($result); 
$random_img=""; 
if($imgsrow['post_id'] == $postrow[$i]['post_id']){ 
echo $i; 
$temp_url = append_sid("randimage.$phpEx?user=".$userdata['user_id']."&post_id=".$postrow[$i]['post_id']); 
$random_img='<a href="' . $temp_url . '"><img src="' . $images['icon_random'] . '" alt="' . $total2 . '" title="' . $i . '" border="0" /></a>'; 
} 
...In that code find...

Code: Select all

echo $i;
...and replace it with...

Code: Select all

// echo $i; 
... sorted ;)

Posted: Thu Oct 30, 2003 11:12 pm
by JJSmallballer
Well... I was looking through my database, and it says where the click me is... and it inserted it into a post that has not been posted yet... is it supposed to do this?

Posted: Thu Oct 30, 2003 11:24 pm
by JJSmallballer
Well... I fixed it ALL. No more numbers, the only thing that should be changed is that the user HAS to be logged on to click on the image!


Whish List:

What is above ^
-Admin Panel Page
-Be able to set how many posts it can be in (like last 10, 20, or whatever) in the admin panel, so it would save it on the database, not in the file.

Posted: Fri Oct 31, 2003 12:58 am
by brazaz
wishlist so far:
1 - stop it from displaying in certain boards
2 - Only show the link to registered users
3 - Be able to set how many posts it can be in in the admin panel
4 - Able to set x number of buttons that would appear
5 - Allow admin to view where the link is

Posted: Sat Nov 01, 2003 4:46 pm
by Kiraly
Works fine! Thanks for the great mod. There is only one thing: the alt tag (mouseover message) is the same number as it was mentioned in the previous posts. I guess I should change $i?

About the wishlist:
1. Makes sense, should be done.
2. Makes sense, should be done.
3. Makes sense, but not essential. It's not something you change very often.
4. No way! It ruins yhe whole idea! Just imagine two or three buttons on the same page! You won't feel like "Yes! I found it!"
5. No good idea. Do you want to ruin your own fun?

Posted: Sat Nov 01, 2003 8:09 pm
by Jeffrey903
Kiraly wrote: 4. No way! It ruins yhe whole idea! Just imagine two or three buttons on the same page! You won't feel like "Yes! I found it!"

Maybe then have it so that if you have more than 1 image, they will always be in different topics (or....something even better could be that once you click on one of them...they all switch places)
Kiraly wrote: 5. No good idea. Do you want to ruin your own fun?

I think that it would be good to know where it is (for the admins only). Especially if you want to test that the mod works. It is possible to see where it is manually, but it's a pain. I really want to be able to see where it is, because I'm going to use this mod for a contest, and would like to know where it is at all times.

Posted: Sat Nov 01, 2003 8:22 pm
by Rapid Dr3am
Also make DBAL.