Jump to content


Random Pic Block


  • You cannot reply to this topic
33 replies to this topic

#1 BPNation

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 02 December 2005 - 04:51 PM

Is there a way to integrate a random pic block with this portal? The portal is decent, but on my site it's missing that feature. Had it with bfarber's portal for 2.0.4, and would love to get it to work with this one.

#2 cricket

    Administrator

  • Root Admin[Root Admin]
  • PipPipPip
  • 301 posts

Posted 06 December 2005 - 10:28 AM

View PostBPNation, on Dec 2 2005, 05:51 PM, said:

Is there a way to integrate a random pic block with this portal? The portal is decent, but on my site it's missing that feature. Had it with bfarber's portal for 2.0.4, and would love to get it to work with this one.


I don't have unreal gallery, so I can't make it. If you can make me an admin on your site with the ability to use the sql toolbox, then I can look at the structure of the table for the gallery and create a block for you.

Edited by cricket, 06 December 2005 - 10:28 AM.

Posted Image

#3 Hottt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 13 December 2005 - 02:31 AM

I need new/random image block too, i use IPB gallery.

#4 chutieu

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 01 January 2006 - 03:27 PM

View PostHottt, on Dec 13 2005, 03:31 AM, said:

I need new/random image block too, i use IPB gallery.


try this code (not mine, can't recall who the author is) . Make sure you change the bold to reflect your site

<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_gallery_images.id as picid,ibf_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ibf_gallery_images` , `ibf_members`
WHERE ibf_gallery_images.member_id = ibf_members.id and ibf_gallery_images.approved=1
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="../forum/index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="../forum/uploads/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>

#5 Hottt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 12 January 2006 - 07:57 AM

Hi!
When i try to add a block with that code i get this:

mySQL query error: UPDATE ibf_up_custcontent SET html='<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_gallery_images.id as picid,ibf_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ibf_gallery_images` , `ibf_members`
WHERE ibf_gallery_images.member_id = ibf_members.id and ibf_gallery_images.approved=1
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="http://kulabu.ru/index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="http://kulabu.ru/photos/1120819310/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>' WHERE name='photos'

SQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_
SQL error code:
Date: Thursday 12th of January 2006 04:56:32 PM

What's wrong?
Thank you!

#6 RobioAXP

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 19 January 2006 - 04:07 PM

I get the same error! Anyone have a suggestion on where the SQL error is coming from?

#7 Arkidas

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 24 January 2006 - 03:52 PM

I also need this :)

#8 chutieu

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 25 January 2006 - 11:10 PM

what is your table prefix? the default prefix is ibf_* . If anything different than the default then you have to change it.

CT

[quote name='Hottt' post='677' date='Jan 12 2006, 08:57 AM']
Hi!
When i try to add a block with that code i get this:

mySQL query error: UPDATE ibf_up_custcontent SET html='<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_gallery_images.id as picid,ibf_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ibf_gallery_images` , `ibf_members`
WHERE ibf_gallery_images.member_id = ibf_members.id and ibf_gallery_images.approved=1
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="http://kulabu.ru/index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="http://kulabu.ru/photos/1120819310/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>' WHERE name='photos'

SQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_
SQL error code:
Date: Thursday 12th of January 2006 04:56:32 PM

What's wrong?
Thank you!
[/quote]

#9 Sysop

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 17 February 2006 - 12:58 AM

Thank you, thank you., thank yoU!!!!!!!!!!

Works fine!!

#10 Sysop

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 19 February 2006 - 09:49 PM

View PostSysop, on Feb 17 2006, 01:58 AM, said:

Thank you, thank you., thank yoU!!!!!!!!!!

Works fine!!



Actually, I should say, I had to modify the code to make it work on my board. The code I used is;



<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ipb_gallery_images.id as picid,ipb_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ipb_gallery_images` , `ipb_members`
WHERE ipb_gallery_images.member_id = ipb_members.id
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="../index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="../uploads/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>


because I don't have my webboard installed in a /forums/ directory.

#11 Sweetz

    Member

  • Members
  • PipPip
  • 11 posts

Posted 05 July 2006 - 11:51 PM

Does anyone no or have tried this with coppermine gallery ? i would love to random pic block with this portal for my Diva site.
Thank you for any help

Sweetz

#12 Sweetz

    Member

  • Members
  • PipPip
  • 11 posts

Posted 08 July 2006 - 09:50 AM

hello anyone here help plz and not at the end of summer either thank you

#13 cwpc

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 July 2006 - 07:15 AM

View Postchutieu, on Jan 1 2006, 06:27 PM, said:

try this code (not mine, can't recall who the author is) . Make sure you change the bold to reflect your site

<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ibf_gallery_images.id as picid,ibf_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ibf_gallery_images` , `ibf_members`
WHERE ibf_gallery_images.member_id = ibf_members.id and ibf_gallery_images.approved=1
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="../forum/index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="../forum/uploads/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>



I used this and it worked Great

Thanks

#14 Azrael

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 23 July 2006 - 09:26 AM

View PostSysop, on Feb 20 2006, 05:49 AM, said:

Actually, I should say, I had to modify the code to make it work on my board. The code I used is;
<?php
echo('<CENTER><TABLE BORDER=0><TR>');
$MZresult = @mysql_query("SELECT ipb_gallery_images.id as picid,ipb_members.name as mname,`masked_file_name`,`directory`,`caption`
FROM `ipb_gallery_images` , `ipb_members`
WHERE ipb_gallery_images.member_id = ipb_members.id
ORDER BY rand()
LIMIT 1");
while ( $MZrow = mysql_fetch_array($MZresult) ) {
echo('<TD ALIGN=CENTER width=99%><a href="../index.php?act=module&module=gallery&cmd=si&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><IMG SRC="../uploads/');
echo($MZrow['directory']. '/tn_'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'border=0 ><BR>by '.$MZrow['mname'].'</TD>');
echo ('</TR><TR>');
}
echo('</TR></TABLE>');
?>
because I don't have my webboard installed in a /forums/ directory.



This worked fabulously on the site I maintain, I merely substituded the Uploads dir for where my gallery images are stored.

Thank you very muchly! :D

#15 Innes

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 July 2006 - 06:22 AM

could this be done with reflections image gallery?

http://klingmandesign.com/reflections/

#16 RisingPhoenix

    Advanced Member

  • Administrators[Admin]
  • PipPipPip
  • 249 posts
  • Gender:Male
  • Location:Fort Benning, GA
  • Interests:I am currently in the US Army. I am not a coder. I am really familiar with Unreal Portal and IPB. So if it isn't in reference to something I have on my site ba4life.com then there isn't much I can do to help you.<br /><br />I am a normal user like most of you. Please don't invade my personal life by asking me questions that can already be found on this website.

Posted 03 August 2006 - 06:10 PM

I noticed that If I change

LIMIT 1");


to
LIMIT 3");


It will show 3 pictures instead of one.

Which is what im looking for, but Does anyone know how to make them run horizontal apposed to vertical?
Posted Image
MultiGaming Clan Playing Games since 1997

#17 Gerry

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • Gender:Male
  • Location:St Helens - UK -

Posted 04 December 2006 - 08:44 AM

Would anyone have this for 2.2 please. This does not work.

Many thanks

#18 nightwisher

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 05 December 2006 - 07:17 AM

Working fine to me ! Thanks a lot !

Friendly
Nightwisher

#19 Gerry

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • Gender:Male
  • Location:St Helens - UK -

Posted 09 December 2006 - 08:18 AM

Does not work for me, this is the error I get, anyone help please

IPB WARNING [2] mysql_fetch_array(): supplied argument is not a valid MySQL result resource (Line: 8 of /sources/action_public/uportal.php(859) : eval()'d code)


#20 chetanhooli

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 December 2006 - 03:29 AM

Yup woyuld be great if we could have a Horizontal version let us know what to change in the code.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users