Hallo ihr Lieben,
Vorweg:
Danke, dass es diese Seite gibt. Ich dachte mir, dass es gar nichts mehr zu PHP-Fusion 9 gibt. Die offizielle Seite ist ja fast gar nicht mehr zu gebrauchen.
Zu mir
Mein Name ist Jazzi bzw. Steffi aus dem RL. Ich betreue eine Webseite, basierend auf der siebten Version von PHP-Fusion, und habe sie mit dem DE-Mod erfolgreich updaten können.
Ich hoffe, ich finde hier Hilfe bzw. Anhaltspunkte, die mir bzw. unserer Community weiterhelfen.
Zum Thema
Wie bereits erwähnt, habe ich ein PHP-Fusion 7 auf die hier angebotene Mod 9 geupdatet. (Nochmals dickes DANKESCHÖN von mir! )
Auf unserer Seite ist die Galerie das Haupt-Feature, und leider finde ich keinen Mod, der mir die zuletzt hochgeladenen Bilder anzeigt.
Ich habe aber das Panel von der 7er Version hier, das wäre der Code:
<?php
/*---------------------------------------------------+
| PHP-Fusion Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
|
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (file_exists(INFUSIONS."photos_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."photos_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."photos_panel/locale/English.php";
}
//openside($locale['MVP100']);
echo "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'><tr>";
//echo "<a href='../../../../../../submit.php?stype=p'><img src='../../../../../../images/upload.png' title='Bild einsenden' style='position:relative; bottom:20px; float:right;'/></a>";
$result=dbquery(
"SELECT ta.album_id,album_title,photo_allow_comments,photo_datestamp,photo_id,photo_title,photo_thumb1 FROM ".$db_prefix."photo_albums ta ".
"INNER JOIN ".$db_prefix."photos USING (album_id) where ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 0,3");
if (dbrows($result) != 0 ) {
while($data = dbarray($result)) {
$filename=PHOTOS.$data['photo_id'].'t.jpg';
$photo_comments = dbcount("(comment_id)", DB_COMMENTS, "comment_type='P' AND comment_item_id='".$data['photo_id']."'");
echo "<td align='left' valign='top' class='gallery'>";
echo "<a href='../../../../../../".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='gallery-title'>".$data['photo_title']."</a>";
if (iADMIN) { echo " <a href='../../../../../../".ADMIN."photos.php".$aidlink."&action=edit&album_id=".$data['album_id']."&photo_id=".$data['photo_id']."' title='Foto bearbeiten' style='position:relative;top:25px;right:5px;float:right;'><img src='../../../../../../".THEME."images/edit.png' width='16' height='16' title='Foto bearbeiten'/></a>";}
echo "<a href='../../../../../../".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' title='".$data['photo_title']."'>";
echo "<img src='../../../../../../".PHOTOS."album_".$data['album_id']."/".$data['photo_thumb1']."' class='gallery-pic' width='100%'></a>";
echo "<div class='gallery-comment'><a href='../../../../../../".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."#comments'><img src='../../../../../../".BASEDIR."images/comment-info.png' border='0' width='16' height='16' style='display:inline;position:relative;top:4px;'/>";
echo ($data['photo_allow_comments'] ? ($photo_comments == 1 ? $locale['MVP102'] : $locale['MVP102']).$photo_comments." Kommentare</a>" : "");
echo "<br></div>n";
echo "</td>";
}
echo "</tr></table>";
} else {
echo $locale['rpc102'];
}
//closeside();
?>
Ich hab schon versucht, den Code auf die 9er Version zu updaten, aber leider hat das nicht funktioniert.
Ich hoffe, ich finde hier fleißige Helfer und auch solche, die es selbst verwenden möchten.
Krelli, wenn das hier klappen sollte, kann das auch gern in deine Download-Sektion aufgenommen werden.
Wie dem auch sei, wenn es hier zu keiner Hilfe kommt, versuche ich es weiter und poste es auch hier.
Ich habe den Code einmal Mit Gemini versucht zu Portieren aber leider fehlanzeige:
<?php
/*---------------------------------------------------+
| PHP-Fusion Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2024 Nick Jones
| https://www.php-fusion.co.uk/
+----------------------------------------------------+
| This code is updated for PHP-Fusion 9.
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
// In PHP-Fusion 9 werden Locales für Infusions meist automatisch geladen.
// Diese Zeilen stellen sicher, dass es auch als eigenständiges Panel funktioniert.
if (file_exists(INFUSIONS."photos_panel/locale/".fusion_get_settings('locale').".php")) {
include INFUSIONS."photos_panel/locale/".fusion_get_settings('locale').".php";
} else {
include INFUSIONS."photos_panel/locale/English.php";
}
// openside() und closeside() werden aus Kompatibilitätsgründen beibehalten.
openside($locale['photo_p_title']); // Annahme, dass MVP100 der Panel-Titel war
// Die Abfrage nutzt jetzt die v9-Konstanten (DB_PHOTOS, DB_PHOTO_ALBUMS)
// und die aktuelle Funktion in_group() zur Überprüfung der Zugriffsrechte.
$result = dbquery("
SELECT pa.album_id, pa.album_title, p.photo_allow_comments, p.photo_datestamp, p.photo_id, p.photo_title, p.photo_thumb1
FROM ".DB_PHOTO_ALBUMS." pa
INNER JOIN ".DB_PHOTOS." p ON pa.album_id = p.album_id
WHERE ".in_group('pa.album_access')."
ORDER BY p.photo_datestamp DESC
LIMIT 3
");
if (dbrows($result) > 0) {
echo "<div class='table-responsive'><table class='table table-striped' style='width:100%;'>n<tr>n";
while ($data = dbarray($result)) {
$photo_comments = dbcount("(comment_id)", DB_COMMENTS, "comment_type='P' AND comment_item_id='".$data['photo_id']."'");
echo "<td class='text-left align-top gallery-item'>";
echo "<h5><a href='".FUSION_ROOT."photogallery.php?photo_id=".$data['photo_id']."' class='gallery-title'>".$data['photo_title']."</a></h5>";
// Admin-Check sollte checkrights() für spezifische Rechte verwenden.
// Der Link nutzt FUSION_ADMIN und ein FontAwesome-Icon statt eines Bildes.
// Der alte $aidlink wird in v9 nicht mehr benötigt.
if (iADMIN && checkrights("P")) {
echo "<a href='".FUSION_ADMIN."photos.php?action=edit&album_id=".$data['album_id']."&photo_id=".$data['photo_id']."' title='".$locale['edit']."' style='position:absolute; top:5px; right:5px;'><i class='fa fa-pencil' title='".$locale['edit']."'></i></a>";
}
echo "<a href='".FUSION_ROOT."photogallery.php?photo_id=".$data['photo_id']."' title='".$data['photo_title']."'>";
// Der Bildpfad verwendet die v9-Konstante IMAGES_P
echo "<img src='".IMAGES_P."album_".$data['album_id']."/".$data['photo_thumb1']."' alt='".$data['photo_title']."' class='img-fluid gallery-pic'></a>";
echo "<div class='gallery-comment m-t-10'>";
echo "<a href='".FUSION_ROOT."photogallery.php?photo_id=".$data['photo_id']."#comments'>";
// Verwendet ein FontAwesome-Icon, was in v9-Themes Standard ist.
echo "<i class='fa fa-comments' style='vertical-align:middle;'></i> ";
// Logik für Kommentare nutzt jetzt Standard-Locales für Singular/Plural.
if ($data['photo_allow_comments']) {
echo $photo_comments." ".($photo_comments == 1 ? $locale['c101'] : $locale['c102']); // c101: Kommentar, c102: Kommentare
}
echo "</a></div>n";
echo "</td>";
}
echo "</tr>n</table></div>n";
} else {
// $locale['p_0027'] ist die Standard-Locale in v9 für "Keine Fotos".
// Ersetze dies, falls deine Locale-Datei einen anderen Schlüssel (z.B. rpc102) verwendet.
echo "<div class='text-center'>".$locale['p_0027']."</div>n";
}
closeside();
?>
Vielen Dank
Steffi