4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: darvid on July 06, 2007, 12:42:55 PM

Title: [MOD] Show best images on extern page
Post by: darvid on July 06, 2007, 12:42:55 PM
Hi,

this is a mod, found by coincedence and some modifications by SLL (http://www.4homepages.de/forum/index.php?topic=3529.msg25302#msg25302 (http://www.4homepages.de/forum/index.php?topic=3529.msg25302#msg25302))


What this MOD will do:

- Shows the most rated picture
- Shows the most voted picture
- Shows the most commented picture
- Shows the most downloaded picture
- Shows the most viewed picture

on a page outside of 4Images! I have used this mod in Wordpress!


ok, lets go:

1. Create a new .php file and name it something like "bestpictures.php" or something like that. Save it in the root folder of 4images.

  so it would look like that: /4images/bestpictures.php

2. Put the following code in it:


Code: [Select]
<?php
// error_reporting(E_ALL);
define('ROOT_PATH''../4images/');
define('SITE_URL''http://www.yourdomain.de/');

// Bild des Tages: für 24 Stunden wird einer der besten Bilder aus
// Datenbank gelesen und angezeigt. Nach 24 Stunden wechselt das Bild.
/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System               *
*    ----------------------------------------------------------------    *
*                                                                        *
*             File: potd.php                                           *
*        Copyright: (C) 2002 Jan Sorgalla                                *
*            Email: jan@4homepages.de                                    *
*              Web: http://www.4homepages.de                             *
*    Scriptversion: 1.0 for 4images 1.7                                *
*                                                                        *
*    Never released without support from: Nicky (http://www.nicky.net) and SLL (;   *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
*    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
*    weitere Informationen.                                              *
*    ---------------------------------------------------------------     *
*    This script is NOT freeware! Please read the Copyright Notice       *
*    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
*    information.                                                        *
*                                                                        *
*************************************************************************/
//Based on the Photo of the Day mod by SLL and V@no
//additional tweaking by Omnirayf 9-5-2003
// and c-bass ( 6. Juli 2007)

include_once(ROOT_PATH.'config.php');
include_once(
ROOT_PATH.'includes/db_mysql.php');
include_once(
ROOT_PATH.'includes/constants.php');

define('PIC_CATEGORIES_TABLE''4images_categories');
define('PIC_IMAGES_TABLE''4images_images');

$pics_db = new Db($db_host$db_user$db_password$db_name);

function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}

echo 
"<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_rating DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most rated<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_votes DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most voted<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_comments DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most commented<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_downloads DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most downloaded<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_hits DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most viewed<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

echo "</tr></table>\n";

?>



3. EDIT in the first lines of the code the domain and the path to your 4images installlation! It might be, if u have different database table name, that u also have to change them in the code.
If u dont want for example shown the most viewed pictures, comment the sql query in the code.


4. Test the file by calling it directly over your browser like http://www.yourdomain.de/4images/bestpictures.php

5. Put this line of code, where u want to have the pictures.

            
Code: [Select]
<?php include("http://www.yourdomain.de/4images/bestpictures.php"); ?>
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: mawenzi on July 06, 2007, 01:07:51 PM
... einige kurze Anmerkungen ... in deutsch ... ;)

1. um gleich dem Query Problem mit MySQL 5.0.x zu entgehen und weitere Nachfragen zu provozieren, solltest du statt :
Code: [Select]
FROM ".PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b
dieses verwenden :
Code: [Select]
FROM (".PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)

2. du schreibst :
Quote
5. Put this line of code, where u want to have the pictures.
Code: [Select]
<?php include("http://www.yourdomain.de/4images/bestpictures.php"); ?>
Das funktioniert nur, wenn die Seite in die integriert werden soll (z.B. Wordpress) auf dem gleichen Webspace liegt.
Willst du die Bilder außerhalb deines Webspce zeigen, so bleibt nur die Einbindung über einen "IFRAME" .
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: darvid on July 06, 2007, 02:14:42 PM
Du hast natürlich recht!

Mmmh...ich hab aber den MySQl 5 und funzt trotzdem.

habs gleich im original code bearbeitet!
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: souwar on August 26, 2007, 08:36:20 AM
can this script be modified for a facebook application?
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: darvid on August 26, 2007, 03:44:43 PM
what exactly u wanna do? would say, it depends on ur skills  :lol:
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: souwar on August 29, 2007, 10:44:27 PM
i wanna be able to do a facebook application and link it to my photogallery.

there is 2 opion:
1- the user will select what category he want to see in his facebook body page ( it's like query search result )

2- or he i will see a mini gallery ( latest pictures )

Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: egyptsons on August 29, 2007, 11:26:29 PM
working fine :D
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: Nicky on August 30, 2007, 09:54:54 PM
hi

nice thing  :)

but no need for that..
Code: [Select]
define('PIC_CATEGORIES_TABLE', '4images_categories');
define('PIC_IMAGES_TABLE', '4images_images');

prefix is in config.php
PIC_CATEGORIES_TABLE & PIC_IMAGES_TABLE
should be changed to
CATEGORIES_TABLE & IMAGES_TABLE
which are in constants.php

user have only to change path & url
Title: Re: [MOD] Show best images on extern page
Post by: janaage01 on September 02, 2007, 06:21:40 PM
Hello,

I wish to chance the color of the background into black or grey und the fontcolor into white.
I think I musst chance something in this script

Code: [Select]
echo "<td><center><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo "<center>\n";
echo "<b>$image_name</b><br>\n";
echo "Most rated<br></td>\n";

(http://www.eintr8-4ever.de/bilder/Unbenannt - 1.jpg)

and I wish to show a randompic in this script (like this script from Nicky.

Can someone help me?
Title: Re: [MOD] Show best images on extern page
Post by: darvid on September 02, 2007, 07:22:04 PM
wieviel ahnung hast du denn von html etc?

du müsstest nur in den htmltabellen den hintergrund bestimmen. oder du fügt eine css klasse hinzu und änderst sie in deinem css stylesheet.
Title: Re: [MOD] Show best images on extern page
Post by: janaage01 on September 02, 2007, 07:27:14 PM
Ich hab leider keine Ahnung davon. Ich nutze nur ein Script für die page wo ich das eingebaut habe.
Title: Re: [MOD] Show best images on extern page
Post by: darvid on September 02, 2007, 07:35:30 PM
suche

Code: [Select]

echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>\n";


ersetze mit

Code: [Select]

echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" bgcolor=\"#000000\"><tr>\n";


 bgcolor=\"#000000\" <--- da muss dann der farbcode stehen
Title: Re: [MOD] Show best images on extern page
Post by: janaage01 on September 02, 2007, 09:00:10 PM
Danke für den Tipp, aber was muss ich im Code ergänzen, wenn ich die Schriftfarbe ändern will?

Code: [Select]
echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" bgcolor=\"#000000\"><tr>\n";

Hast Du event. auch eine Idee, wie das Zufallsbild eingebunden werden kann?
Title: Re: [MOD] Show best images on extern page
Post by: janaage01 on September 02, 2007, 09:24:58 PM
Ja, aber das klappt leider nicht in dem Code oben. Ich kenn mich zuwenig damit aus, aber kann es sein, dass die html-Anweisungen in php etwas anders lauten?
Title: Re: [MOD] Show best images on extern page
Post by: darvid on September 03, 2007, 09:57:19 AM
ja dat wird wohl mit der css datei zusammenhängen. ohne die basics, kommst du so nicht weit.
Title: Re: [MOD] Show best images on extern page
Post by: sami1255 on October 16, 2007, 11:51:49 PM
What if i want 10 most viewed pictures instead of one.. hope there will be only slight modification..  :roll:
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 17, 2007, 12:54:49 AM
Good god - lot of SQL query there ...  8O

@sami1255:

if change all this in code:

Quote
LIMIT 1";

Change 1 for your value. .;)
Title: Re: [MOD] Show best images on extern page
Post by: sami1255 on October 17, 2007, 07:27:49 AM
i tried that.. didnt work for me..  :cry: the mod still shows the same 5 images..
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 17, 2007, 01:02:37 PM
If you clear cookies, temp files, close browser, re-open browser to gallery - is same result ?
Title: Re: [MOD] Show best images on extern page
Post by: sami1255 on October 17, 2007, 03:44:09 PM
yeah.. its the same..! :roll:
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 17, 2007, 08:13:50 PM
Ask author of MOD. ;)
Title: Re: [MOD] Show best images on extern page
Post by: darvid on October 17, 2007, 09:06:54 PM
sami, u cant show more than one BEST image. the mod is not like top.php and shows the ranking of the 20 best pics. the mod shows you THE BEST image either by download, by comments, by hits and so on. u ve got to decide, what u want. this might not be the right mod for u.
Title: Re: [MOD] Show best images on extern page
Post by: sami1255 on October 17, 2007, 09:24:01 PM
thanks c-bass for your quick reply..  :)
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 17, 2007, 09:43:26 PM
@c-bass:

One thing. After function is_remote block,

add this:

Code: [Select]
function safe_htmlspecialchars($chars) {
  // Translate all non-unicode entities
  $chars = preg_replace(
    '/&(?!(#[0-9]+|[a-z]+);)/si',
    '&amp;',
    $chars
  );

  $chars = str_replace(">", "&gt;",   $chars);
  $chars = str_replace("<", "&lt;",   $chars);
  $chars = str_replace('"', "&quot;", $chars);
  return $chars;
}

function replace_url($text) {
  $text = " ".$text." ";
  $url_search_array = array(
    "#([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \(\)<>\n\r]*)?)#si",
    "#([^]_a-z0-9-=\"'\/])([a-z]+?)://([^, \(\)<>\n\r]+)#si"
  );

  $url_replace_array = array(
    "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\" rel=\"nofollow\">www.\\2.\\3\\4</a>",
    "\\1<a href=\"\\2://\\3\" target=\"_blank\" rel=\"nofollow\">\\2://\\3</a>",
  );
  $text = preg_replace($url_search_array, $url_replace_array, $text);

  if (strpos($text, "@")) {
    $text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
  }
  return substr($text, 1, -1);
}

function replace_badwords($text) {
  global $config, $split_badwords;
  if ($config['badword_list'] != "") {
    if (!isset($split_badwords)) {
      $badwords = trim($config['badword_list']);
      $badwords = preg_replace("/[\n\r]/is", " ", $badwords);
      $badwords = str_replace(","," ",$badwords);
      $badwords = preg_quote($badwords);
      $badwords = str_replace('/', '\\/', $badwords);
      $split_badwords = preg_split("/\s+/", $badwords);
    }

    foreach ($split_badwords as $key => $val) {
      if ($val != "") {
        if (substr($val, 0, 2) == "\\{") {
          $val = substr($val, 2, -2);
          $text = trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si", "\\1".str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
        }
        else {
          $text = trim(preg_replace("/$val/si", str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
        }
      }
    }
  }
  return $text;
}

function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
    $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }

  if ($html == 0 || $html == 2) {
    $text = safe_htmlspecialchars($text);
  }

  if ($html !== 2) {
    $text = nl2br(trim($text));
    $text = replace_url($text);
  }

  if ($bbcode == 1) {
    $search_array = array(
      "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
      "/(\[)(list)(])(.*)(\[\/list\])/siU",
      "/(\[\*\])/siU",
      "/(\[\/\*\])/siU",
      "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
      "/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
      "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
      "/javascript:/si",
      "/about:/si"
    );
    $replace_array = array(
      "<ol type=\"\\5\">\\7</ol>",
      "<ul>\\4</ul>",
      "<li>",
      "</li>",
      "<a href=\"http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
      "<a href=\"\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
      "<a href=\"http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
      "<a href=\"\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
      "<pre>Code:<hr size=1>\\5<hr size=1></pre>",
      "java script:",
      "about :"
    );
    $text = preg_replace($search_array, $replace_array, $text);
    if (!$bbcode_img)  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
    }
    else  {
      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
    }
    $text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
    $text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
    $text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);

    $text = replace_badwords($text);
  }

  $text = str_replace("\\'", "'", $text);

  return $text;
}

Replace all:

Quote
$image_name = $row['image_name'];

for:

Code: [Select]
$image_name = format_text(trim($row['image_name']), 2);
Title: Re: [MOD] Show best images on extern page
Post by: mathuatden on October 24, 2007, 12:22:53 PM
I have an error with this mod
My error is when member post a comment is in my gallery have 2 same comments
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 24, 2007, 01:07:23 PM
Quote
My error is when member post a comment is in my gallery have 2 same comments

This is right. I no think 4images use compare for match comments in details.php file.
Title: Re: [MOD] Show best images on extern page
Post by: darvid on October 24, 2007, 05:05:25 PM
this should have nothing to do with this mod.
Title: Re: [MOD] Show best images on extern page
Post by: thunderstrike on October 24, 2007, 08:32:17 PM
No, is nothing to do. ;)
Title: Re: [MOD] Show best images on extern page
Post by: naist on December 16, 2007, 07:35:31 PM
I've installed the mod, but the images are not shown on extern pages but only image names and the links for this images. Look at the screenshot. I've used the Include code on the external page, but something must be wrong. Any idea?
Title: Re: [MOD] Show best images on extern page
Post by: KurtW on December 16, 2007, 08:05:44 PM
Hi naist,

i thing, you lost a part of this modcode (img src):
Code: [Select]
echo "<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";


Kurt
Title: Re: [MOD] Show best images on extern page
Post by: naist on December 17, 2007, 06:51:16 PM
Hi Kurt,
thanks for the quick response. But the code I've used is the same as shown. I've taken another screenshot with IE 7.0. The the same result: Not the image is shown but a link to the details.php with the pictures in it. Any other idea? Thanks! naist
Title: Re: [MOD] Show best images on extern page
Post by: darvid on December 17, 2007, 08:49:42 PM
well, it seems, that you have modfied code in other files. it would be the best, if you post a real demo link here. maybe it is just the path to your images....
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 24, 2008, 04:16:28 PM
Hallo

Wenn man nicht eingeloggt ist und Gäste keine Bilder sehen dürfen (Nur Thumbs) dann gibt es beim Klick auf das Bild einen 404er. Kann man das so ändern, das zur index.php der Gallerie umgeleitet wird?

Title: Re: [MOD] Show best images on extern page
Post by: darvid on January 24, 2008, 04:26:49 PM
kann man bestimmt  :lol:

hast du nen link parat? theoretisch müsste doch dieselbe seite kommen, als wenn du in der gallery auf ein bild klickst. sowas wie "sie sind nicht angemeldet...nur angemeldete user dürfen die bilder sehen..."
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 24, 2008, 04:38:52 PM
kann man bestimmt  :lol:

hast du nen link parat? theoretisch müsste doch dieselbe seite kommen, als wenn du in der gallery auf ein bild klickst. sowas wie "sie sind nicht angemeldet...nur angemeldete user dürfen die bilder sehen..."

Hier ist der Link

http://www.reptilienmanager.de/gallery/topanywhere.php

Wenn Du nicht angemeldet bist, dann kann man in der Gallerie nur die Bilder anklicken die für Gäste sichtbar sind. Evtl. könnte man das ja übernehmen?

Title: Re: [MOD] Show best images on extern page
Post by: mawenzi on January 24, 2008, 05:03:57 PM
... nicht für ungut, aber ich wiederhole mich ständig ...
... 'SCRIPT_URL' bzw. 'SITE_URL' und/oder 'ROOT_PATH' stimmen nicht ...
... denn in den Links über die Thumbnails fehlt ... /gallery/ ... ergibt : Error404 ...
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 24, 2008, 05:08:51 PM
... nicht für ungut, aber ich wiederhole mich ständig ...
... 'SCRIPT_URL' bzw. 'SITE_URL' und/oder 'ROOT_PATH' stimmen nicht ...
... denn in den Links über die Thumbnails fehlt ... /gallery/ ... ergibt : Error404 ...

Das hatte ich nach der Änderung übersehen, aber jetzt passiert beim Klick garnichts mehr, bzw. die php-Datei ruft sich selber auf :(

Title: Re: [MOD] Show best images on extern page
Post by: darvid on January 24, 2008, 06:17:09 PM
uff.. das hat glaube nichts mehr mit meinem mod zu tun.

du hast irgendwo eingestellt, dass man auf die startseite umgeleitet wird. da hast du aber nicht direkt pfad zur startseite eingestellt, sondern den relativen, vermute ich.

wo hast du das denn geändert?
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 24, 2008, 09:26:31 PM
Ich hab da garnichts eingestellt oder geändert. Der MOD ist im Original (ausser ROOT_PATH ect.). Die Änderungen waren in anderen Dateien.

Wie ist es denn bei euch mit dem MOD, oder habt ihr alle die Bilder für Gäste freigegeben? Dann könnte es ja mal jemand Testen.

Title: Re: [MOD] Show best images on extern page
Post by: Nicky on January 24, 2008, 09:58:08 PM
für gäste freigegeben
http://www.nicky.net/4test/best.php
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 24, 2008, 11:00:13 PM
für gäste freigegeben
http://www.nicky.net/4test/best.php

Hm... Komische Sache. Na mal sehen ...

Title: Re: [MOD] Show best images on extern page
Post by: darvid on January 25, 2008, 09:44:28 AM
vielleicht kannst du mit einem trick arbeiten.

.. wenn user nicht eingeloggt, dann lasse link weg
.. wenn user eingeloggt sind, dann schreibe link

also so wie du es jetzt auch gemacht hast, nur noch mit einer abfrage.
Title: Re: [MOD] Show best images on extern page
Post by: rubberduck on January 25, 2008, 12:05:58 PM
Ja, das hatte ich bei dem hier

http://www.4homepages.de/forum/index.php?topic=1020.msg110066#msg110066

auch schon gemacht.

Mich würde aber eher der Grund interessieren, warum es so nicht geht. Nimmt man sich die fertige URL zur details.php mit der Bild-ID und gibt die direkt im Browser ein, an ist auch alles korrekt. Nur beim Klick kommt diese komische Umleitung.

Title: Re: [MOD] Show best images on extern page
Post by: satine88 on February 11, 2008, 12:05:10 PM
Hello,
I have a error :( :

http://www.wallpaper-gratuit.net/bestpictures.php

Please help
Title: Re: [MOD] Show best images on extern page
Post by: Nicky on February 11, 2008, 01:31:52 PM
maybe you pointed to wrong path where you config.php is..

i think it should be so
Code: [Select]
define('ROOT_PATH', './');
define('SITE_URL', 'http://www.wallpaper-gratuit.net/');

when this is the url > http://www.wallpaper-gratuit.net/bestpictures.php
Title: Re: [MOD] SHOW BEST IMAGES ON EXTERN PAGE
Post by: Sebas Bonito on September 07, 2009, 12:27:53 AM
i wanna be able to do a facebook application and link it to my photogallery.

there is 2 opion:
1- the user will select what category he want to see in his facebook body page ( it's like query search result )

2- or he i will see a mini gallery ( latest pictures )



Is it done, or has somebody else seen a mod to connect to facebook?