Random IP.Gallery Block
#1
Posted 29 January 2007 - 09:50 PM
I am trying to link a random pic block to my forum gallery. I have some code that was posted on another forum for the last five pics in the forum view.
Now mind you I am no coder. I have tried to make this thing work. I have also looked at the code in mkportal gallery block. I have no clue what I am doing, could you please give me some insite as to where I should start.
I have dreamweaver to edit with. I have tried to do this on my own. I have also posted on the mkportal forums about it. They told me to look at the codes I have already mentioned to you. I have been trying to get it for the last four days and no success.
Thanks for your time.
-----------
EDIT by visiblesoul: edited topic title
#2
Posted 29 January 2007 - 10:15 PM
BudmannG said:
I am trying to link a random pic block to my forum gallery. I have some code that was posted on another forum for the last five pics in the forum view.
Now mind you I am no coder. I have tried to make this thing work. I have also looked at the code in mkportal gallery block. I have no clue what I am doing, could you please give me some insite as to where I should start.
I have dreamweaver to edit with. I have tried to do this on my own. I have also posted on the mkportal forums about it. They told me to look at the codes I have already mentioned to you. I have been trying to get it for the last four days and no success.
Thanks for your time.
I am not completely clear about what you want to do.
Do you want to display images from the MKPortal Gallery, IP.Gallery, Coppermine, Gallery2 or some other gallery?
-=DKC=-
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#3
Posted 29 January 2007 - 10:21 PM
#4
Posted 30 January 2007 - 02:02 AM
BudmannG said:
http://www.mkportal.it/index.php?ind=downl...y_view&iden=282
I will be coding a Subdreamer block for IP.Gallery tomorrow so I will try to port it to MKPortal if I get a chance. I am stretched a little thin this week.
-=DKC=-
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#5
Posted 30 January 2007 - 06:43 AM
#6
Posted 30 January 2007 - 10:28 AM
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#7
Posted 30 January 2007 - 10:35 AM
#8
Posted 02 February 2007 - 05:30 PM
BudmannG said:
I'm almost finished with my Subdreamer block for IP.Gallery so soon I will make one for MKPortal. But it will probably take a few more days.
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#9
Posted 04 February 2007 - 01:56 PM
I figured most of it out. I have added to the code that you wrote in random_ips_gallery.php. I had to add the directory in with the url. I don't want to get in trouble for posting the code here. If I won't get in trouble I will show you the changes.
I did add an extra line in it to show how many views the picture has had. But once I got the picture to work it went away and I don't know if it is because of the size of the block in MKPortal or what.
But I got it to work!!!!!
Let me know about posting the code. Because I could use the help to get the # of views back up in there.
Thanks for all your help!
#10
Posted 05 February 2007 - 07:31 AM
BudmannG said:
I figured most of it out. I have added to the code that you wrote in random_ips_gallery.php. I had to add the directory in with the url. I don't want to get in trouble for posting the code here. If I won't get in trouble I will show you the changes.
I did add an extra line in it to show how many views the picture has had. But once I got the picture to work it went away and I don't know if it is because of the size of the block in MKPortal or what.
But I got it to work!!!!!
Let me know about posting the code. Because I could use the help to get the # of views back up in there.
Thanks for all your help!
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#11
Posted 05 February 2007 - 10:37 AM
$content = "";
$query = $DB->query("SELECT id FROM ibf_gallery_images");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, directory, views, caption as titolo, masked_file_name as file FROM ibf_gallery_images where approved = '1' LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "tn_$file";
$directory = $foto['directory'];
$views = $foto['views'];
Here is the second.if (!file_exists("$this->sitepath/forum/uploads/$directory/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$file" border="0" width='$thumb_mes[0]' height='$thumb_mes[1]' alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>
<tr><td id="tdblock" align="center">$views Views
</td></tr>";
} else {
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$thumb" border="0" alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>";
}
I left out the code that is between the second and third part. As I didn't have to change it. But here is the third part.unset($query); unset($count); unset($start); unset($foto); unset($id); unset($titolo); unset($file); unset($thumb); unset($views); unset($directory);
#12
Posted 07 February 2007 - 07:48 PM
I finally got it all to work right. Will you post it back up on MKPortal as an updated mod for the portal? I think that most would use this alot as I am very happy with it now. Thank you for all your help on this, I know you are busy at the moment. That is why I worked on it myself.
<?
/*
+--------------------------------------------------------------------------
| MKportal Random IPS Gallery Pic 20.01.2005
| for MKP x IPB2
| by mr_zaz
| based on MkPortal random_pic.php by Meo <mkportal.it>
+---------------------------------------------------------------------------
|
| > MKPortal
| > Written By Amedeo de longis
| > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
$content = "";
$query = $DB->query("SELECT id FROM ibf_gallery_images");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, directory, views, caption as titolo, masked_file_name as file FROM ibf_gallery_images where approved = '1' LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "tn_$file";
$directory = $foto['directory'];
$views = $foto['views'];
if (!file_exists("$this->sitepath/forum/uploads/$directory/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$file" border="0" width='$thumb_mes[0]' height='$thumb_mes[1]' alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>
<tr><td id="tdblock" align="center">$views Views
</td></tr>";
} else {
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$thumb" border="0" alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>
<tr><td id="tdblock" align="center">$views Views
</td></tr>";
}
if(!$id) {
$content = "<tr>
<td id="tdblock" align="center">
{$this->lang['no_galleryim']}
</td>
</tr>
";
}
if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) {
$content = "<tr>
<td id="tdblock" align="center">
{$this->lang['gallery_noallow']}
</td>
</tr>
";
}
unset($query);
unset($count);
unset($start);
unset($foto);
unset($id);
unset($titolo);
unset($file);
unset($thumb);
unset($views);
unset($directory);
?>
Well there it is complete. I hope to see it on MKPortal soon as a update. Thanks again.Here is a screen shot of it in action.
#13
Posted 08 February 2007 - 08:30 AM
BudmannG said:
I finally got it all to work right. Will you post it back up on MKPortal as an updated mod for the portal? I think that most would use this alot as I am very happy with it now. Thank you for all your help on this, I know you are busy at the moment. That is why I worked on it myself.
<?
/*
+--------------------------------------------------------------------------
| MKportal Random IPS Gallery Pic 20.01.2005
| for MKP x IPB2
| by mr_zaz
| based on MkPortal random_pic.php by Meo <mkportal.it>
+---------------------------------------------------------------------------
|
| > MKPortal
| > Written By Amedeo de longis
| > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
$content = "";
$query = $DB->query("SELECT id FROM ibf_gallery_images");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, directory, views, caption as titolo, masked_file_name as file FROM ibf_gallery_images where approved = '1' LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "tn_$file";
$directory = $foto['directory'];
$views = $foto['views'];
if (!file_exists("$this->sitepath/forum/uploads/$directory/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$file" border="0" width='$thumb_mes[0]' height='$thumb_mes[1]' alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>
<tr><td id="tdblock" align="center">$views Views
</td></tr>";
} else {
$content = "<td align="center"><a href="$this->siteurl/forum/index.php?act=module&module=gallery&cmd=si&img=$id"><img src="$this->siteurl/forum/uploads/$directory/$thumb" border="0" alt="{$this->lang['gallery_zoom']}"></a></td></tr>
<tr><td id="tdblock" align="center">$titolo
</td></tr>
<tr><td id="tdblock" align="center">$views Views
</td></tr>";
}
if(!$id) {
$content = "<tr>
<td id="tdblock" align="center">
{$this->lang['no_galleryim']}
</td>
</tr>
";
}
if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) {
$content = "<tr>
<td id="tdblock" align="center">
{$this->lang['gallery_noallow']}
</td>
</tr>
";
}
unset($query);
unset($count);
unset($start);
unset($foto);
unset($id);
unset($titolo);
unset($file);
unset($thumb);
unset($views);
unset($directory);
?>
Well there it is complete. I hope to see it on MKPortal soon as a update. Thanks again.Here is a screen shot of it in action.
http://img144.images...nshot005ck3.gif
-=DKC=-
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#14
Posted 08 February 2007 - 10:18 AM
#15
Posted 09 February 2007 - 07:10 AM
BudmannG said:
Quote
| MKportal Random IP.Gallery Image 2.0 09.02.2007
| for MKPortal x IPB2
| by visiblesoul
| based on MkPortal random_pic.php by Meo
| and Random IPS Gallery Pic by mr_zaz
+---------------------------------------------------------------------------
Quote
| MKportal Random IPS Gallery 2.0 09.02.2007
| for MKP x IPB2
| by mr_zaz
| based on MkPortal random_pic.php by Meo
| updated for IP.Gallery version 2.1.x by visiblesoul
+---------------------------------------------------------------------------
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
#16
Posted 09 February 2007 - 08:28 AM
| MKportal Random IP.Gallery Image 2.0 09.02.2007
| for MKPortal x IPB2.2
| by BudmannG
| based on MkPortal random_pic.php by Meo
| and Random IPS Gallery Pic by mr_zaz
+---------------------------------------------------------------------------
This way looks good to me. It felt good to accomplish this on my own. The latest post one is going to be a bit harder.
Thanks again Visible!
#17
Posted 09 February 2007 - 09:32 AM
BudmannG said:
| MKportal Random IP.Gallery Image 2.0 09.02.2007
| for MKPortal x IPB2.2
| by BudmannG
| based on MkPortal random_pic.php by Meo
| and Random IPS Gallery Pic by mr_zaz
+---------------------------------------------------------------------------
This way looks good to me. It felt good to accomplish this on my own. The latest post one is going to be a bit harder.
Thanks again Visible!
---------------------------------------
EDIT: I uploaded the block here...
http://www.mkportal.it/index.php?ind=downl...y_view&iden=791
I would also like permission to add the block to my own downloads section here..
http://www.visibleso...rces/downloads/
Thanks.
-=DKC=-
Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.
Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.
"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














