4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Ty on August 13, 2007, 02:16:05 AM

Title: [MOD] Latest pictures on an external page
Post by: Ty on August 13, 2007, 02:16:05 AM
How can I show the latest uploaded pictures on my home page (outside the Gallery)?
Title: Re: Latest pictures on an external page
Post by: manurom on August 14, 2007, 02:20:49 AM
Hello;
as I use to be a lazzy guy, here is the solution I use, by using the code of the file "index.php".
Fill it with this code:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: index.php                                            *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'new_images,thumbnail_bit_extern';
$main_template 'new_images';
define('ROOT_PATH''./');

define('GET_CACHES'1);
define('GET_USER_ONLINE'1);
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();

if (isset(
$HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
  
$template = (isset($HTTP_GET_VARS['template'])) ? get_basefile(stripslashes($HTTP_GET_VARS['template'])) : get_basefile(stripslashes($HTTP_POST_VARS['template']));
  if (!
file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
    
$template "";
  }
  else {
    
$main_template $template;
  }
}
else {
  
$template "";
}
include(
ROOT_PATH.'includes/page_header.php');

if (!empty(
$template)) {
  
$clickstream "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_"" "ucfirst($template));
  
$site_template->register_vars("clickstream"$clickstream);
  
$site_template->print_template($site_template->parse_template($main_template));
  include(
ROOT_PATH.'includes/page_footer.php');
}

$cache_id create_cache_id(
  
'page.index',
  array(
    
$user_info[$user_table_fields['user_id']],
    isset(
$user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 08) : 0,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_index || !$content get_cache_file($cache_id)) {
// Always append session id if cache is enabled
if ($cache_page_index) {
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"has_rss"   => true,
  
"rss_title" => "RSS Feed: ".format_text($config['site_name'], 2)." (".str_replace(':'''$lang['new_images']).")",
  
"rss_url"   => $script_url."/rss.php?action=images"
));

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

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$num_new_images $config['image_cells'];
$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 NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT 
$num_new_images";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$new_images "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_images .= $lang['no_new_images'];
  
$new_images .= "</td></tr></table>";
}
else  {
  
$new_images "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row);
    
$new_images .= $site_template->parse_template("thumbnail_bit_extern");
    
$new_images .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$new_images .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$new_images .= "</tr>\n";
    }
  }
  
$new_images .= "</table>\n";
// end else

$site_template->register_vars("new_images"$new_images);
unset(
$new_images);

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_index) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>

Find:
Code: [Select]
"thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),
Insert just after:
Code: [Select]
"thumbnail_extern" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
"thumbnail_extern_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),

Find now:
Code: [Select]
  return $thumb;
}

And insert this just after:
Code: [Select]
//--External thumbnails--------------------------------
function get_thumbnail_extern_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 1) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

//--End external thumbnails----------------------------


The file new_images.html will contain:
Code: [Select]
<style type="text/css">
<!--
.title {
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
-->
</style>
<table width="70%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
    <td align="center" valign="top"><span class="title">Recent Images from {site_name}</span></td>
  </tr>
  <tr>
    <td align="center" valign="top"><br />
      {new_images} <br /></td>
  </tr>
</table>

And the file thumbnail_bit_extern:
Code: [Select]
<style type="text/css">
<!--
.pics {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.new {
  font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
  font-size: 9px;
  color: #FF0000;
}
-->
</style>

<div align="center">{thumbnail_extern_openwindow}<br />
  <span class="pics"><b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
  <br /></span></div>


In your external site, you may call your 4images new_images thumbnails by two ways, PHP and HTML.

PHP:
Code: [Select]
<?php include ('http://path_to_your_4images_gallery/new_images.php'?>
HTML:
Code: [Select]
<iframe src="http://path_to_your_4images_gallery/new_images.php" width="500" height="300" scrolling="no" frameborder="0" name="new_images" align="center"></iframe>
If you click on a thumbnail, a new page opens showing the detailed view of the image.
It is also possible to link instead to your gallery homepage, or the image categoy with a little modification.

Here you are. I know that it maybe not the best way, but it works fine with 4images 1.7.4... and I'm really too lazzy to find another way.
Title: Re: Latest pictures on an external page
Post by: kowalski on August 14, 2007, 10:58:19 AM
thanks for this code manurom
Title: Re: Latest pictures on an external page
Post by: manurom on August 16, 2007, 12:53:40 AM
Just one more thing;
if you prefer to display your 4images original template colours, just replace the code in new_images.html with this one:
Code: [Select]
{header}
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
    <td align="left" class="head1" valign="top">&nbsp;&nbsp;Recent Images from {site_name}</td>
  </tr>
  <tr>
    <td class="head1"><br />
      {new_images} <br /></td>
  </tr>
</table>
Title: Re: Latest pictures on an external page
Post by: Ty on August 18, 2007, 04:03:17 AM
Thank you so much!!  :D :D :D

But how can I change the number of images displayed?
Title: Re: Latest pictures on an external page
Post by: manurom on August 18, 2007, 01:58:28 PM
Hello;
let's say you want to show 8 images.
Change:
Code: [Select]
$num_new_images = $config['image_cells'];to:
Code: [Select]
$num_new_images = 8;
$config['image_cells'] = 8;

If you prefer to show 8 images in two rows of 4 images:
Code: [Select]
$num_new_images = 8;
$config['image_cells'] = 4;
Title: Re: Latest pictures on an external page
Post by: Ty on August 18, 2007, 09:49:28 PM
Thank you sooo much!!!!  :D :D :D :D :D
Title: Re: [MOD] Latest pictures on an external page
Post by: sribhavan143 on July 19, 2008, 07:11:34 PM
I have this eurre :(


Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/www/28b3a706622af374d9c64f386fcc83ab/web/test.php on line 7

Warning: include(http://www.kadhalroses.com/gallery/new_images.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/www/28b3a706622af374d9c64f386fcc83ab/web/test.php on line 7

Warning: include() [function.include]: Failed opening 'http://www.kadhalroses.com/gallery/new_images.php' for inclusion (include_path='.:/opt/php/lib/php') in /home/www/28b3a706622af374d9c64f386fcc83ab/web/test.php on line 7
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 20, 2008, 05:07:29 PM
fein, fein
direkt in meiner Topliste eingebaut  :mrgreen:
http://www.exclusiv-topsites.de/topsites/topsites/TOPLISTE-1107K/index.html
und werde es noch auf meiner HP einbauen
Was mir noch fehlt, ist wenn man auf´s Bild klickt, das sich die Seite komplett öffnet

hat da einer eine Idee ??

LG. Harald
Title: Re: [MOD] Latest pictures on an external page
Post by: Sunny C. on July 20, 2008, 06:08:10 PM
Die Seite öffnet sich doch komplett!?
Wenn ich auf ein Bild klicke dann öffnet sich deine Seite einmal neu!
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 20, 2008, 06:14:36 PM
aber nicht ganz ?
im IE und FF wird nur ein Teil geöffnet, und lässt sich auch nicht in Vollansicht anklicken ? (Vista)

Edit: und wenn man den Kat Link anklickt wird keine neue Seite geöffnet
wie es gändert würde, würde mir ja schon einfallen, nur finde ich die Stellen nicht   :?

Title: Re: [MOD] Latest pictures on an external page
Post by: Sunny C. on July 20, 2008, 06:23:11 PM
Das liegt wohl an dir.
bei mir öffnet sich das alles ganz normal!
Klicke ich dann in der Topliste auf eines der Bild, dann öfnet sich die Seite direkt bei mir in einem neuen Tab!
Ps.: habe auch Vista (Ultimate)

Edit: Wenn ich den Katlink klicke, dann öffnet sich die Seite nur in dem bereich wo es eingebunden wurde!

Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 20, 2008, 06:28:28 PM
Edit: Wenn ich den Katlink klicke, dann öffnet sich die Seite nur in dem bereich wo es eingebunden wurde!

stelle gefunden, nur wenn ich das ändere, gilt es auch für den Katalog
es müsste also eine neue Variable gemacht werden, die nur für diese Sache gilt

mal sehn ob ich alle Stellen finde  :wink:

Edit:
So auf {cat_url_extern} geändert

nur welche muss ich auf target setzen  :?

"cat_url_extern" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),

oder

"cat_url_extern" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$category_id),

und vielleicht noch wie  :wink:
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 20, 2008, 09:03:20 PM
kein Profi da, der da ein target="blank" einfügen könnte  :cry:
hab zwar einige Vorlagen gfunden, aber keiner klappte
LG. Harald
Title: Re: [MOD] Latest pictures on an external page
Post by: KurtW on July 20, 2008, 09:41:39 PM
Hallo,

ich kenn zwar deinen Aufbau nicht, aber hier:
Code: [Select]
"cat_url_extern" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),kannste normalerweise kein target einfügen...

Siehe z.B. user_logininfo.html
Code: [Select]
&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br /> und das dazugehörige in includes/page_header.php
Code: [Select]
  "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"), 
Bei deiner Variante wäre das target im link selbst.
Du musst das target in der html beim Aufruf des linkes mit einbauen:
Code: [Select]
&raquo; <a href="{url_lightbox}" target="_blank">{lang_lightbox}</a><br />oder den php code umschreiben:
Code: [Select]
  "cat_url_extern" => "<a href=\"".$site_sess->url(ROOT_PATH."admin/categories.php?url_cat_id=".$image_row['cat_id'])."\" target=\"_blank\">Link</a>",   



Kurt
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 20, 2008, 10:01:13 PM
Danke, klappte mit dem
Code: [Select]
&raquo; <a href="{url_lightbox}" target="_blank">{lang_lightbox}</a><br />
man sucht einfach immer nach der schwersten Lösung, dabei ist es meist ganz nah  :wink:

LG. Harald
Title: Re: [MOD] Latest pictures on an external page
Post by: Sunny C. on August 13, 2008, 01:36:37 AM
Hab die Mod mal eingebaut,
nur, werden keine Bilder angezeitgt wenn ich {thumbnail_extern_openwindow} verwende!
Wenn ich aber {thumbnail} geht das, wie auf dem Bild zu sehen! Aber es öffnet sich im iFrame..

Im Anhang sind die Bilder:
Aufzeichnung = Forum
Aufzeichnung2 = Gallery
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on August 13, 2008, 08:43:43 PM
hast du auch eine thumbnail_bit_extern.html erstellt ?

kopiere die thumbnail_bit.html und nenne diese um in thumbnail_bit_extern.html
editieren, wie sie erscheinen soll.

Quote
Aber es öffnet sich im iFrame..
dann füge den Code so ein

Code: [Select]
<?php include ('http://path_to_your_4images_gallery/new_images.php'?>
Title: Re: [MOD] Latest pictures on an external page
Post by: Nicky on August 13, 2008, 10:46:10 PM
ich werde mich nur kurz einmischen, das es zu keinen misverständnissen kommt

path = pfad = /home/userid/www/htdocs
url = url = http://url_to_your_gallery/new_images.php

so :)
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on August 13, 2008, 10:56:41 PM
 :wink:
aber keine Ahnung was Phisker B gegen den Einbau von Iframe im Kit (nehme an soll da rein) hat
als Content einbinden, und fertig, läuft ohne Probleme.
Title: Re: [MOD] Latest pictures on an external page
Post by: Sunny C. on August 13, 2008, 11:11:44 PM
Ich nutze kein Kit!
Ich möchte es in das Forum bekommen.
Ich nutze das gleiche Forum wie hier!
Aber aber schon Antwort seitens SMF bekommen!
Der Einbau ins Kit ist das einfachste was es gibt.. aber ich nutze kein Kit!

Dennoch danke für die Antworten!
Title: Re: [MOD] Latest pictures on an external page
Post by: Safariguy on August 16, 2008, 04:18:37 PM
I've gone over the various links on this topic and am now stuck with this error message.

Quote
Security violationSecurity violationSecurity violation
Fatal error: Call to undefined function: create_cache_id() in /home/content/W/e/n/Wendorff/html/WENDORFF/Portfolio/new_images.php on line 56

Can someone please help me sort this out?

Jeff
Title: Re: [MOD] Latest pictures on an external page
Post by: V@no on August 16, 2008, 07:22:22 PM
You must be using 4images v1.7

Try this mod: [MOD] Cache System for 4images v1.7 (http://www.4homepages.de/forum/index.php?topic=8476.0)
Title: Re: [MOD] Latest pictures on an external page
Post by: Safariguy on August 16, 2008, 09:10:55 PM
I am using Ver 1.76. I'll give that mod a whirl.

Thank you V@no

Title: Re: [MOD] Latest pictures on an external page
Post by: Safariguy on August 16, 2008, 09:27:44 PM
After reading that post, I didn't look like I should not install this mod on my 1.76 installation. I should say too that this a fresh install with very little mods.

Tag Cloud and Check all files are the only mods.
Title: Re: [MOD] Latest pictures on an external page
Post by: Safariguy on August 17, 2008, 03:40:18 PM
GOT IT! Something that I should have done again yesterday... There are so many posts on this that I think that I was trying to combine MODs. Anyway, carefully doing exactly what is in this thread only, I got my thumbs over to my blog.

Cheers,
Jeff
Title: Re: [MOD] Latest pictures on an external page
Post by: yousaf on May 29, 2009, 04:19:26 PM
This thing is working fine for me on my gallery site.[ mysite.com/new_images.php]

but on the external site (2nd website) i am unable to see thumbnails.
due to the wrong thumbnail and link address.

link on my gallery website is like this

http://www.gallerywebsite.com/wallpaper-Green-Landscape-20.html

on the external website's page where i embedded the new_images.php shows me this link and thumbnail address like this

http://www.externalwebsite.com/wallpaper-Green-Landscape-20.html

while its should be pointing the gallery site's link and thumbnail

http://www.gallerywebsite.com/wallpaper-Green-Landscape-20.html
Title: Re: [MOD] Latest pictures on an external page
Post by: yousaf on May 30, 2009, 04:24:19 PM
sorry for bumping
anyone to help?
Title: Re: [MOD] Latest pictures on an external page
Post by: Jan-Lukas on July 09, 2009, 10:42:24 PM
keine Probleme mit Version 1.7.7

LG Harald
Title: Re: [MOD] Latest pictures on an external page
Post by: tvcrazyman on November 11, 2009, 11:57:43 PM
I've got the same problem. Got version 1.7.7, got seo mod and anytime I try and use a insert code like so

<!--#include virtual="/art/mynewpics.php" -->

It totally leaves out the /art/ in the links. Driving me nuts. But if I open it like a regular web page mysite.com/art/mynewpics.php the links are ok.

Somehow I need to tell it to add the /art/ in the address, but I don't know how.
Title: Re: [MOD] Latest pictures on an external page
Post by: V@no on November 12, 2009, 01:18:35 AM
what if you use full path (http://mysite.com/art/mynewpics.php) or relative path ( ./art/mynewpics.php )?
Title: Re: [MOD] Latest pictures on an external page
Post by: tvcrazyman on November 12, 2009, 06:36:22 PM
Well I used the entire web address for a test php page on the outside of my art folder and it just did the same thing. It skips the /art/ folder in the address.
Title: Re: [MOD] Latest pictures on an external page
Post by: Yan on December 26, 2009, 08:20:40 PM
How change the url and img src path to absolute path gallery.site.ru ?

I try to change this code in functions.php

Code: [Select]
//--External thumbnails--------------------------------
function get_thumbnail_extern_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 1) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

//--End external thumbnails----------------------------

But it works even without this code in functions.php 8O 8O
Title: Re: [MOD] Latest pictures on an external page
Post by: vitorlima on January 16, 2010, 04:47:36 AM
how do I open the images in another window? images in _blank
Title: Re: [MOD] Latest pictures on an external page
Post by: Jockl on September 17, 2011, 06:12:40 PM
Hi!

I used this script for a long time. Now I've had to change the server and now sometimes the following error message is displayed twice:

Code: [Select]
Warning: Cannot modify header information - headers already sent by (output started at .../header.php:31) in .../4images/includes/sessions.php on line 101
What could be the problem? This error message does not show up in 4images, only in the new_images php included on an external site.

Best regards
Title: Re: [MOD] Latest pictures on an external page
Post by: V@no on September 17, 2011, 07:02:29 PM
What's in your header.php first 50 lines?
Title: Re: [MOD] Latest pictures on an external page
Post by: Jockl on September 18, 2011, 08:43:38 AM
What's in your header.php first 50 lines?
Why 50 lines? There are only 31 lines in the header.php

It's only one table

Code: [Select]
<table style="width:100%" cellpadding="0" cellspacing="1" border="0" class="tableoutborder">
.....
</table>
<br />
Title: Re: [MOD] Latest pictures on an external page
Post by: Jockl on September 19, 2011, 09:27:49 PM
No more ideas what could be the problem?
Title: Re: [MOD] Latest pictures on an external page
Post by: midohits on January 02, 2012, 09:45:59 PM
i wanna know how i can make a new page for a specific category not to all image directory
Title: Re: [MOD] Latest pictures on an external page
Post by: V@no on January 03, 2012, 02:23:56 AM
Hello and welcome to 4images forum.

Replace in new_images.php
Code: [Select]
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")With this:
Code: [Select]
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")" . ($cat_id ? " AND i.cat_id = $cat_id" : "") . "

After that you can use cat_id url query to specify a category: http://example.com/4images/new_images.php?cat_id=123
Title: Re: [MOD] Latest pictures on an external page
Post by: Jasi on February 20, 2012, 10:17:05 AM
Hallo an Alle,

kann via php include nichts ausgegeben bekommen:

Warning: main() [function.include]: Failed opening 'http://www.xyz.net/fotoarchiv/new_images.php' for inclusion (include_path='.:') in /www/htdocs/ariana/schwibboegen_old.php on line 226

Nur via IFRAME und das ist ja nicht so der Hit mit dem weißen Background immer (´Blendeffekt beim IFRAME').

Könnt Ihr mir bitte helfen, danke  :)