Author Topic: +++ TOP RATED PICTURES ON EXTERN PAGE ??  (Read 3273 times)

0 Members and 1 Guest are viewing this topic.

Offline darvid

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • KNOWTEBOOK.COM - Community for webdeveloper
+++ TOP RATED PICTURES ON EXTERN PAGE ??
« on: June 28, 2007, 04:04:35 PM »
Hi,

i want to show the top rated pictures of 4images on an external page (in my blog) outside of the 4images directory.

4images path: www.homepage.de/photos/
blog path: www.homepage.de/blog/

I used the code of the MINI-TOP MOD, but get several errors:
            
Code: [Select]
<?php

define
('GET_CACHES'1);
define('ROOT_PATH''./photos/');
$user_access get_permission();

$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

 
$mini_top_images "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
 
$mini_top_images .= "<tr class=\"imagerow1\">\n";

 
$selection = array('rating''votes''hits''comments''downloads');
 
$selection_alt = array('votes DESC''rating DESC''name ASC''name ASC''name ASC');
# $selection_cutoff = array(' AND i.image_votes > 10', '', '', '', '');

 
$num_of_cells $config['image_cells'];
 
$num_of_cells $num_of_cells count($selection) ? count($selection) : $num_of_cells;

 for (
$cnt 0$cnt $num_of_cells$cnt++) {

 
$mini_top_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN ("
.get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."
        ORDER BY i.image_"
.$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt];

 
$result $site_db->query_firstrow($sql);
 
show_image($result);
 
$site_template->register_vars("lang_mini_top_mode"$lang['mini_top_'.$selection[$cnt]]);
 
$mini_top_images .= $site_template->parse_template("mini_top_bit");
 
$mini_top_images .= "\n</td>\n";
}

 
$mini_top_images .= "</tr>\n";
 
$mini_top_images .= "</table>\n";

 
$site_template->register_vars(array(
  
"mini_top_images" => $mini_top_images,
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_mini_top_title" => $lang['mini_top_title']
 ));
unset(
$mini_top_images);

?>

error:

Fatal error: Call to undefined function: get_permission() in /htdocs/blog/wp-content/themes/pilotenbilder_2007/uebersicht.php on line 110

in line 110 is the following code:

$user_access = get_permission();
/* KNOWTEBOOK - BoostYourself community for webdeveloper
/* http://www.knowtebook.com

Integration von Wordpress Blog, PHPBB Forum und 4Images Bildergalerie:
http://www.sebastianscheuer.de/aktuell/integration-von-wordpress-blog-phpbb-forum-und-4images-bildergallerie/
DEMO: http://www.pilotenbilder.de/