16
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
@Harry,
here is it:
http://www.nicky.net/4images/random_more_pics.txt
for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360
<?php include("random_cat1.php") ?>
<?php include("random_cat2.php") ?>
<?php include("random_cat1.php") ?>
<?php include("random_cat2.php") ?>
<?php include("random_cat1.php") ?>
Ok, i see. The PHP Code for the functions you posted above is not original one. Maybe you opened it in a HTML-Editor who corrupted the code. Replace "includes/functions.php" with the originla one and try it again.
Greets Jan
Can you give us a link to see this in action?
Greets Jan
function get_category_dropdown_bits($cat_id, $cid = 0, $depth = 1) {
global $site_db, $drop_down_cat_cache, $cat_cache;
if (!isset($drop_down_cat_cache[$cid])) {
return "";
}
$category_list = "";
foreach ($drop_down_cat_cache[$cid] as $key => $category_id) {
if (check_permission("auth_viewcat", $category_id)) {
$category_list .= "<select>
<option value=\"".$category_id."\"";
if ($cat_id == $category_id) {
$category_list .= " selected=\"selected\"";
}
if ($cat_cache[$category_id]['cat_parent_id'] == 0) {
$category_list .= " class=\"dropdownmarker\"";
}
if ($depth > 1) {
$category_list .= ">".str_repeat("--", $depth - 1)." ".$cat_cache[$category_id]['cat_name']."</option>\n";
}
else {
$category_list .= ">".$cat_cache[$category_id]['cat_name']."</option>\n";
}
$category_list .= get_category_dropdown_bits($cat_id, $category_id, $depth + 1);
}
}
unset($drop_down_cat_cache[$cid]);
return $category_list;
}
function get_category_dropdown($cat_id, $jump = 0, $admin = 0, $i = 0) {
global $lang, $drop_down_cat_cache, $cat_parent_cache;
// $admin = 1 Main Cat (update/add cats)
// $admin = 2 All Cats (find/validate images...)
// $admin = 3 Select Cat (update/add image)
// $admin = 4 No Cat (check new images)
switch ($admin) {
case 1:
$category = "\n
</select><select name=\"cat_parent_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['main_category']."</option>\n";
$category .= "<option value=\"0\">--------------</option>\n";
break;
case 2:
$category = "\n
</select><select name=\"cat_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['all_categories']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 3:
$i = ($i) ? "_".$i : "";
$category = "\n
</select><select name=\"cat_id".$i."\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['select_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 4:
$category = "\n
</select><select name=\"cat_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['no_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 0:
default:
if ($jump) {
$category = "\n
</select><select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }\" class=\"categoryselect\">\n";
}
else {
$category = "\n
</select><select name=\"".URL_CAT_ID."\" class=\"categoryselect\">\n";
}
$category .= "<option value=\"0\">".$lang['select_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
} // end switch
$drop_down_cat_cache = array();
$drop_down_cat_cache = $cat_parent_cache;
$category .= get_category_dropdown_bits($cat_id);
$category .= "</select>\n";
return $category;
}
Hi,
includes/constants.php:Code: [Select]define('MAX_RATING', 5);
Jan
// OPEN / ÖFFNE includes/functions.php:
// ADD AFTER / HINZUFÜGEN DANACHCode: [Select]
if ($image_row['image_rating'] == '5.00') {
$rating_pic = "5.gif";
} elseif ($image_row['image_rating'] >= '4.00') {
$rating_pic = "4.gif";
} elseif ($image_row['image_rating'] >= '3.00') {
$rating_pic = "3.gif";
} elseif ($image_row['image_rating'] >= '2.00') {
$rating_pic = "2.gif";
} elseif ($image_row['image_rating'] >= '1.00') {
$rating_pic = "1.gif";
} else {
$rating_pic = "0.gif";
}
$site_template->register_vars("rating_pic", $rating_pic);
{user_box} is defined at the bottom of "includes/page_header.php". You can register new template variables with:Code: [Select]$site_template->register_vars(array(
"menu" => "Content of menu",
"variable2" => "Test Test"
));
Greets Jan