4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: titi-fr on March 16, 2005, 10:43:48 AM

Title: integration in html page of selected photos ?
Post by: titi-fr on March 16, 2005, 10:43:48 AM
hello all

i've installed few weeks ago the mod who permit to see in html pages the last x images or random images...

but in fact i search the same, but with "selected images" aka i go the admin panel, & i select images i want to display in html pages

does it exist ? i'm not a programmer so :x
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 17, 2005, 02:57:06 PM
 :oops: ouinnnn  :P someone could help me ?  :?:
Title: Re: integration in html page of selected photos ?
Post by: b.o.fan on March 17, 2005, 04:24:26 PM
i don´t understand your question...!

in german? or in a better english?? 8) 8)
Title: Re: integration in html page of selected photos ?
Post by: Chris on March 17, 2005, 07:05:17 PM
Too cryptic without enough details.  I didn't understand the post either.
Title: Re: integration in html page of selected photos ?
Post by: Vincent on March 17, 2005, 10:02:26 PM
Hello
i think he would like to have the possibility to make a group of a couple of picture!
maybe he is looking for something like that http://www.foto-kocher.com/sol.php
but in my case it is done by hand in html
because i am not able to code this in php

sincerly
vincent
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 18, 2005, 02:13:58 PM
ok sorry i'm french, i'll try to be comprehensible, i search for a mod who works like the " last images integration in html page" ( to show last images tn in an other site written in html) but the same mod with thumbnail i selected in the gallery, not the last xxx images.

so in the admin, a mod interface who permit the selection of tn images i want to display in html pages ...


better ? :)
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 19, 2005, 11:19:00 PM
not understandable ? :/
Title: Re: integration in html page of selected photos ?
Post by: Chris on March 20, 2005, 06:54:32 PM
No, just too much custom coding to voluneer for.  :wink:
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 22, 2005, 09:02:10 AM
ok, i wasnt thinking this idea is too strange  :roll:
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 22, 2005, 05:48:54 PM
maybe an idea ... I have installed the integration in html page ( who display the last ten pix).

here the source of the file latest.php, :

Code: [Select]
<?php 
define
('ROOT_PATH''./annonces/'); 
define('SITE_URL', /'); 

$db_servertype = "mysql"; 
$db_host = "xxxx"; 
$db_name = "xxxx"; 
$db_user = "xxxx"; 
$db_password = "xxxx"; 

$table_prefix = "4images_"; 

define('
4IMAGES_ACTIVE', 1); 

include_once('
db_mysql.php'); 

define('
PIC_CATEGORIES_TABLE', '4images_categories'); 
define('
PIC_IMAGES_TABLE', '4images_images'); 
define('
THUMB_DIR', 'data/thumbnails'); 
define('
AUTH_ALL', 0); 
define('
AUTH_USER', 2); 
define('
AUTH_ACL', 3); 
define('
AUTH_ADMIN', 9); 

$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)) ? 1 : 0; 


$sql "SELECT COUNT(*) as total_images FROM ".PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=".AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL.""
$row $pics_db->query_firstrow($sql); 
$total_images $row['total_images']; 

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_date FROM ".PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=".AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL." ORDER BY a.image_date DESC LIMIT 3"

$result $pics_db->query($sql); 
while (
$row $pics_db->fetch_array($result)) { 
   
$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'] : SITE_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']; 

   echo 
"<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a target=\"a\" href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"><br>Cliquez sur l'image</a><br>\n"
   echo 
"$image_name<br>\n"
   echo 
"</font>\n"
}


if i add a additional filed ( ex. "promote"), with : 1 for promoting pictures is there a way to use the script to find & display the pictures with promote value=1 ?
Title: Re: integration in html page of selected photos ?
Post by: V@no on March 23, 2005, 01:20:29 AM
if i add a additional filed ( ex. "promote"), with : 1 for promoting pictures is there a way to use the script to find & display the pictures with promote value=1 ?
yep, that would be your best bet ;)
ones u added the new field, u can retreve your "promote" images by adding AND promote = 1 into sql query:
Quote
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_date FROM ".PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=".AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL." AND promote = 1 ORDER BY a.image_date DESC LIMIT 3";
Title: Re: integration in html page of selected photos ?
Post by: titi-fr on March 23, 2005, 09:32:34 AM
whoooaaaa seems good  :lol:

hum i dont find the original post for adding extra custom fields ... :/

ex http://www.4homepages.de/forum/index.php?topic=1413.0

i think the tutorial was not reup after the attack ... :/