Пример #1
0
    //    $public_albums = cpg_db_query("SELECT DISTINCT aid, title, IF(category = 0, CONCAT('&gt; ', title), CONCAT(name,' &lt; ',title)) AS cat_title FROM {$CONFIG['TABLE_ALBUMS']}, {$CONFIG['TABLE_CATEGORIES']} WHERE category < '" . FIRST_USER_CAT . "' AND (category = 0 OR category = cid) ORDER BY cat_title");  // albums weren't coming up in the list when there were no cats
    $public_albums = cpg_db_query("SELECT DISTINCT aid, title, IF(category = 0, CONCAT('&gt; ', title), CONCAT(name,' &lt; ',title)) AS cat_title FROM {$CONFIG['TABLE_ALBUMS']} LEFT JOIN {$CONFIG['TABLE_CATEGORIES']} ON category = cid WHERE category < '" . FIRST_USER_CAT . "' ORDER BY cat_title");
} else {
    $forbidden_set_alt = $FORBIDDEN_SET ? 'AND ' . str_replace('p.', '', $FORBIDDEN_SET) : '';
    //    $public_albums = cpg_db_query("SELECT DISTINCT aid, title, IF(category = 0, CONCAT('&gt; ', title), CONCAT(name,' &lt; ',title)) AS cat_title FROM {$CONFIG['TABLE_ALBUMS']} LEFT JOIN {$CONFIG['TABLE_CATEGORIES']} ON category = cid WHERE category < '" . FIRST_USER_CAT . "' AND uploads = 'YES' $forbidden_set_alt ORDER BY cat_title"); //when user edited own image and no album was uploadable album list was empty
    $public_albums = cpg_db_query("SELECT DISTINCT aid, title, IF(category = 0, CONCAT('&gt; ', title), CONCAT(name,' &lt; ',title)) AS cat_title FROM {$CONFIG['TABLE_ALBUMS']} LEFT JOIN {$CONFIG['TABLE_CATEGORIES']} ON category = cid WHERE (category < '" . FIRST_USER_CAT . "' AND uploads = 'YES' {$forbidden_set_alt}) OR aid='{$CURRENT_PIC['aid']}' ORDER BY cat_title");
}
if (mysql_num_rows($public_albums)) {
    $public_albums_list = cpg_db_fetch_rowset($public_albums);
} else {
    $public_albums_list = array();
}
if (GALLERY_ADMIN_MODE && $CURRENT_PIC['owner_id'] != USER_ID) {
    get_user_albums($CURRENT_PIC['owner_id']);
} else {
    get_user_albums();
}
echo <<<EOT
<script type="JavaScript">
function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
}
</script>
<form name="editonepicform" method="post" action="editOnePic.php">
<input type="hidden" name="id" value="{$CURRENT_PIC['pid']}" />
EOT;
starttable("100%", $lang_editpics_php['desc'], 3);
//$pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], ($CURRENT_PIC['filesize'] >> 10), $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
if (!is_movie($CURRENT_PIC['filename'])) {
    $pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], $CURRENT_PIC['filesize'] >> 10, $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
}
if ($CONFIG['user_field4_name'] != '') {
    $THUMB_ROWSPAN++;
}
if (GALLERY_ADMIN_MODE) {
    $public_albums = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < '" . FIRST_USER_CAT . "' ORDER BY title");
    if (mysql_num_rows($public_albums)) {
        $public_albums_list = db_fetch_rowset($public_albums);
    } else {
        $public_albums_list = array();
    }
    mysql_free_result($public_albums);
} else {
    $public_albums_list = array();
}
get_user_albums(USER_ID);
starttable("100%", $lang_editpics_php['desc'], 3);
echo <<<EOT
<SCRIPT LANGUAGE="JavaScript">
function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
}
</script>
EOT;
$pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], $CURRENT_PIC['filesize'] >> 10, $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
print <<<EOT
<table align="center" width="100%" cellspacing="1" cellpadding="0" class="maintableb">
        <form method="post">
        <input type="hidden" name="pid" value="{$CURRENT_PIC['pid']}">
        <tr>
}
if ($CONFIG['user_field4_name'] != '') {
    $THUMB_ROWSPAN++;
}
if (GALLERY_ADMIN_MODE) {
    $public_albums = db_query("SELECT DISTINCT aid, title, IF(category = 0, CONCAT('&gt; ', title), CONCAT(name,' &lt; ',title)) AS cat_title FROM {$CONFIG['TABLE_ALBUMS']}, {$CONFIG['TABLE_CATEGORIES']} WHERE category < '" . FIRST_USER_CAT . "' AND (category = 0 OR category = cid) ORDER BY cat_title");
    if (mysql_num_rows($public_albums)) {
        $public_albums_list = db_fetch_rowset($public_albums);
    } else {
        $public_albums_list = array();
    }
    mysql_free_result($public_albums);
} else {
    $public_albums_list = array();
}
get_user_albums($CURRENT_PIC['owner_id']);
echo <<<EOT
<script type="JavaScript">
function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
}
</script>
<form method="post" action="editOnePic.php">
<input type="hidden" name="id" value="{$CURRENT_PIC['pid']}" />
EOT;
starttable("100%", $lang_editpics_php['desc'], 3);
//$pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], ($CURRENT_PIC['filesize'] >> 10), $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
if (!is_movie($CURRENT_PIC['filename'])) {
    $pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], $CURRENT_PIC['filesize'] >> 10, $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
} else {
Пример #4
0
             header('Location: ' . $config['BASE_URL'] . '/error/invalid_module');
             die;
         }
     } else {
         $template = 'user_' . $module;
         require 'modules/user/' . $module . '.php';
     }
 } else {
     $prefs = get_user_prefs($uid);
     $is_friend = is_friend($uid);
     $friends = get_user_friends($uid, $prefs['show_friends'], $is_friend);
     $playlist = get_user_playlist($uid, $prefs['show_playlist'], $is_friend);
     $favorites = get_user_favorites($uid, $prefs['show_favorites'], $is_friend);
     $subscriptions = get_user_subscriptions($uid, $prefs['show_subscriptions'], $is_friend);
     $subscribers = get_user_subscribers($uid, $prefs['show_subscribers'], $is_friend);
     $albums = get_user_albums($uid);
     $photos = get_user_favorite_photos($uid, $prefs['show_favorites'], $is_friend);
     $games = get_user_favorite_games($uid, $prefs['show_favorites'], $is_friend);
     $show_wall = false;
     $wall_public = $prefs['wall_public'];
     $walls = array();
     $walls_total = 0;
     if ($wall_public == '1') {
         $show_wall = true;
     } else {
         if ($is_friend) {
             $show_wall = true;
         } elseif (isset($_SESSION['uid']) && $_SESSION['uid'] == $uid) {
             $show_wall = true;
         }
     }