Tach!
Folgendes:
Ich verwende das modul My eGallery und habe dort Bereiche für "Member" eingetragen. Diese sind ja bekanntlich für normale User nicht zu sehen. Allerding sollten die Zufallsbilder auf der Startseite sich auch an diese Einstellungen halten. Die Kartegorien, die nur für den Admin einsehbar sind, die werden ja schon auf der Startseite weggelassen. Wo kann ich das Einstellen, dass die Member-Kartegorie freigelassen wird?
(einzelne änderungen habe ich schon vorgenommen, deshalb hier der komplette code)<?php // $Id: block-RandomPic.php,v 1.1 2005/03/19 18:14:25 tora60 Exp $
/************************************
pragmaMx Content Management System
Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
***********************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***********************************
$Source: /cvsroot/pragmamx/stable/blocks/block-RandomPic.php,v $
$Revision: 1.1 $
$Author: tora60 $
$Date: 2005/03/19 18:14:25 $
***********************************
this file based on:
php-nuke Web Portal System - http://phpnuke.org/
Thatware - http://thatware.org/
((((but many changes))))
************************************/
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
$mxblockcache = FALSE;
global $prefix;
include 'admin/modules/gallery/config.php';
mt_srand((double)microtime()*1000000);
if (mxIsUser())
list($total) = sql_fetch_row(sql_query("SELECT COUNT(p.pid) AS total FROM ".$prefix."_gallery_pictures AS p LEFT JOIN ".$prefix."_gallery_categories AS c ON c.gallid=p.gid WHERE (extension='jpg' OR extension='gif' OR extension='png') AND c.visible>=1"));
else
list($total) = sql_fetch_row(sql_query("SELECT COUNT(p.pid) AS total FROM ".$prefix."_gallery_pictures AS p LEFT JOIN ".$prefix."_gallery_categories AS c ON c.gallid=p.gid WHERE (extension='jpg' OR extension='gif' OR extension='png') AND c.visible>=2"));
$p = (empty($total)) ? 0 : mt_rand(0,($total - 1));
if (mxIsUser())
$pic = sql_fetch_array(sql_query("SELECT p.pid, p.img, p.name, p.description, c.galloc FROM ".$prefix."_gallery_pictures AS p LEFT JOIN ".$prefix."_gallery_categories AS c ON c.gallid=p.gid WHERE (extension='jpg' OR extension='gif' OR extension='png') AND c.visible>=1 LIMIT $p,1"));
else
$pic = sql_fetch_array(sql_query("SELECT p.pid, p.img, p.name, p.description, c.galloc FROM ".$prefix."_gallery_pictures AS p LEFT JOIN ".$prefix."_gallery_categories AS c ON c.gallid=p.gid WHERE (extension='jpg' OR extension='gif' OR extension='png') AND c.visible>=2 LIMIT $p,1"));
$pic["description"] = htmlentities($pic["description"]);
if (@file_exists("$gallerypath/".$pic["galloc"]."/thumb/".$pic["img"].""))
$content = "<center><a href=\"$baseurl&do=showpic&pid=$pic[pid]\"><img src=\"$gallerypath/".$pic["galloc"]."/thumb/".$pic["img"]."\" border=\"0\" alt=\"".$pic["description"]."\"><br><font class=\"tiny\">".$pic["name"]."</font></a></center>";
else
if (@file_exists("$gallerypath/".$pic["galloc"]."/".$pic["img"].""))
$content = "<center><a href=\"$baseurl&do=showpic&pid=$pic[pid]\"><img src=\"$gallerypath/".$pic["galloc"]."/".$pic["img"]."\" width=\"300\" border=\"0\" alt=\"".$pic["description"]."\"><br><b><font size=\"1\">".$pic["name"]."</font></a></b></center>";
?>