Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Falk
    Post made: 4
  • karrak
    Post made: 1
  • Sladdaren
    Post made: 1
  • omikron20
    Post made: 5

  1. PHP-Fusion Support Forums
  2. PHP-Fusion 9 Support
  3. Modifications and Requests

Latest photo panel

Post your modification and request questions for v9 here.

10 Replies 487 Views Last Updated on 6 days ago

omikron20


Junior Member

#1

Posted 2 months ago

Hi I hope I wrote in good forum
On my website I have panel with latest added photo. Can somebody help to modify my code to work on PF9 ?
This is the code on my panel on PF 7.02.07 website.
Code Gist: Download source  

openside("Ostatnio dodane zdjęcia");
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT
4"
);
if(dbrows($result)>0){
echo "<table align='center' cellpadding='0' cellspacing='4'><tr>";
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo "<td align='center'><a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='gallery'><img src='".$randphotodir.$data['photo_thumb1']."' title='".$data['photo_title']."' alt='".$data['photo_title']."' border='0' /></a></td>";
}
echo "</tr></table>";
}
closeside();

Posts: 26

Joined: 05/11/2015

Falk


Super Admin

#2

Posted 2 months ago

Here is a start,

Code Gist: Download source  

openside("Ostatnio dodane zdj&#281;cia");

// include INFUSIONS."gallery/infusion_db.php";

$result=dbquery(
"SELECT tp.*, ta.* FROM ".DB_PHOTOS." tp
LEFT JOIN ".DB_PHOTO_ALBUMS." ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT
4"
);
if(dbrows($result)>0){
echo "<table align='center' cellpadding='0' cellspacing='4'><tr>";
while ($data=dbarray($result)) {
echo "<td align='center'><a href='".INFUSIONS."gallery/gallery.php?photo_id=".$data['photo_id']."' class='gallery'><img src='".INFUSIONS."gallery/photos/thumbs/".$data['photo_thumb1']."' title='".$data['photo_title']."' alt='".$data['photo_title']."' border='0' /></a></td>";
}
echo "</tr></table>";
}
closeside();

Posts: 3662

Joined: 27/09/2005

Sladdaren


Junior Member

#3

Posted 2 months ago

Very nice panelGood. haven´t seen this in the download section..But now i got it..Smile
http://volvoswede... - Forum för oss som kör Volvo

Posts: 18

Joined: 26/11/2013

omikron20


Junior Member

#4

Posted 2 months ago

Thanks for this, But I don't know how to use it on PF9. In PF7 I add this code in panel, and it's work when I go on website. But when I do it on PF9 my web site show me code what i put into panel.
Edited by Falk on 20-02-2017 23:29

Posts: 26

Joined: 05/11/2015

Falk


Super Admin

#5

Posted 2 months ago

You need to enable PHP from Security settings, https://www.php-fusion.co.uk/infusions/wiki/doc...p?page=266

Posts: 3662

Joined: 27/09/2005

omikron20


Junior Member

#6

Posted 2 months ago

Thanks for answer, I set to enable php in settings, but still not working. Always shows code in panel.
Edited by Falk on 21-02-2017 20:38

Posts: 26

Joined: 05/11/2015

Falk


Super Admin

#7

Posted 2 months ago

If you have the latest version it should work, maybe you are on a older RC?
Get latest here, https://github.com/php-fusion/PHP-FusionPHP-Fusion

Posts: 3662

Joined: 27/09/2005

omikron20


Junior Member

#8

Posted 10 days ago

Can somebody help me with this panel ? I always get only php code like on attached screen.

Posts: 26

Joined: 05/11/2015

Falk


Super Admin

#9

Posted 9 days ago

If you follow the steps and use my code it should work, Just tested again and it works for me..

Posts: 3662

Joined: 27/09/2005

omikron20


Junior Member

#10

Posted 7 days ago

Yes workowy good. Its not shows on preview, but on website its work.
Edited by Falk on 17-04-2017 04:13

Posts: 26

Joined: 05/11/2015

karrak


Senior Member

#11

Posted 6 days ago

the above code works

enable
administration -> settings -> security
Allow PHP Execution = Yes

Posts: 221

Joined: 20/07/2008

Jump to Forum:
3 users are online
0 member and 3 guests