Show Posts

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.


Messages - SLL

Pages: 1 ... 3 4 5 6 [7] 8 9 10 11 ... 27
91
Mods & Plugins (Releases & Support) / Five in a row...
« on: May 25, 2003, 02:32:57 PM »
Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;
define&#40;'SITE_URL', 'http&#58;//faces.dalnet.ru/'&#41;;

include_once&#40;ROOT_PATH.'config.php'&#41;;
include_once&#40;ROOT_PATH.'includes/db_mysql.php'&#41;;
include_once&#40;ROOT_PATH.'includes/constants.php'&#41;;

define&#40;'PIC_CATEGORIES_TABLE', '4images_categories'&#41;;
define&#40;'PIC_IMAGES_TABLE', '4images_images'&#41;;

$pics_db = new Db&#40;$db_host, $db_user, $db_password, $db_name&#41;;

function is_remote&#40;$file_name&#41; &#123;
  
return &#40;preg_match&#40;'#^https?\\&#58;\\/\\/[a-z0-9\-&#93;+\.&#40;[a-z0-9\-&#93;+\.&#41;?[a-z&#93;+#i', $file_name&#41;&#41; ? 1 &#58; 0;
&#125;

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&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

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&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

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&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

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&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

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&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

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";

?>

92
Mods & Plugins (Releases & Support) / [Mod] Photo Of The Day
« on: May 25, 2003, 02:16:05 PM »
Quote from: balu
The whole??? I deleted it but still no pic!
I am a total newbie in php, how must realize this?


 8O   that's what you have to leave in the code, not delete! just compare it to original...

93
Mods & Plugins (Releases & Support) / [Mod] Photo Of The Day
« on: May 25, 2003, 01:59:16 PM »
Quote from: balu
which line I have to delete?

Code: [Select]
$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 $select_mode DESC
LIMIT 1";

Quote from: balu
btw. is it possible to view 4 pictures? mot voted, most download, most view, most rate in 1 row?

you have to make 4 copies of sql query and set different $select_mode for each one.

94
Mods & Plugins (Releases & Support) / [Mod] Photo Of The Day
« on: May 25, 2003, 01:00:34 PM »
Hmm.. looks OK... as you can see at your site, no one pic and category given out from SQL query.

As an idea - check permitions in your 4images, if everybody allowed to see pics, not registered/logged-in only. Or remove all references to AUTH_ALL in this code

95
Mods & Plugins (Releases & Support) / [Mod] Photo Of The Day
« on: May 25, 2003, 10:11:55 AM »
Quote from: balu
is it possible to insert this php i a html site on a other server?

no
Quote from: balu
btw. I got this error:

original POTD mod has to be installed first.

97
Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;
define&#40;'SITE_URL', 'http&#58;//www.mygallery.com/'&#41;;

include_once&#40;ROOT_PATH.'config.php'&#41;;
include_once&#40;ROOT_PATH.'includes/db_mysql.php'&#41;;
include_once&#40;ROOT_PATH.'includes/constants.php'&#41;;

define&#40;'PIC_CATEGORIES_TABLE', '4images_categories'&#41;;
define&#40;'PIC_IMAGES_TABLE', '4images_images'&#41;;

$pics_db = new Db&#40;$db_host, $db_user, $db_password, $db_name&#41;;

function is_remote&#40;$file_name&#41; &#123;
  
return &#40;preg_match&#40;'#^https?\\&#58;\\/\\/[a-z0-9\-&#93;+\.&#40;[a-z0-9\-&#93;+\.&#41;?[a-z&#93;+#i', $file_name&#41;&#41; ? 1 &#58; 0;
&#125;

switch &#40;POTD_SELECT_MODE&#41; &#123;
case "by_rating" &#58; $select_mode = "a.image_rating"; break;
case "by_votes" &#58; $select_mode = "a.image_votes"; break;
case "by_comments" &#58; $select_mode = "a.image_comments"; break;
case "by_downloads" &#58; $select_mode = "a.image_downloads"; break;
case "by_hits" &#58; $select_mode = "a.image_hits"; break;
&#125;

$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 AND b.auth_viewcat="
.AUTH_ALL." AND b.auth_viewimage=".AUTH_ALL."
ORDER BY 
$select_mode DESC
LIMIT 1"
;

$row $pics_db->query_firstrow&#40;$sql&#41;;
$image_id $row['image_id'&#93;;
$cat_id $row['cat_id'&#93;;
$image_name $row['image_name'&#93;;
$image_comments $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

echo "<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><div class=\"ltgreytext\">$image_name</b></div>\n";
echo 
"Selected by rates<br>\n";

?>


save as potd.php and then include as <?php include("./potd.php"); ?> into your site index.php

98
Mods & Plugins (Requests & Discussions) / Mod Request: Guestbook
« on: May 24, 2003, 04:28:57 PM »
hmm... just checked few of available php/mysql gusetbooks... none of them has user registration/database. so, what are you going to integrate with 4images? i didn't get the idea...

99
Mods & Plugins (Requests & Discussions) / Re: guestbook
« on: May 24, 2003, 02:56:01 PM »
Quote from: kief24
a nice guestbook you can be found at http://www.lkcc.org:8500/index.php

in order to be integrated with 4images, the guestbook has to run mysql as a storage. this one doesn't...

100
Mods & Plugins (Requests & Discussions) / Annotation Mark
« on: May 23, 2003, 08:22:51 PM »
Sure, sure, sure...

If anyone wants to make an image gallery, he can run Notepad, create plain index.html, insert few manualy prepared thumbs into it and proudly call it My Fantastic Image Gallery  :lol:  :lol:   :wink:

101
Mods & Plugins (Requests & Discussions) / Re: MOD
« on: May 23, 2003, 02:30:37 PM »
Quote from: cisiodon
I simgle command line

???
Quote from: cisiodon
Use imagemagick

both IM & GD used in Annotation MOD
Quote from: cisiodon
You can select what image

The whole idea on the MOD is to process images automatically, there's no need to select anything
Quote from: cisiodon
You can convert from/to simultaneous

???  Simultaneous with what??
Quote from: cisiodon
Do not need GD

GD is used for proper annotation text positioning. You need to know you message size for alignment.

102
Mods & Plugins (Releases & Support) / v.1.3
« on: May 23, 2003, 11:45:44 AM »
Version 1.3 available for download.

New in v.1.3

• You can choose the annotation method now: text annotation or embedded PNG image (logo, text, etc.). Image embedding (hopefully) works with ImageMagick even if GD library is not installed on your server.


I'd appreciate if this MOD users send to sll@dalnet.ru translation to your languages (including English/German text corrections, if any), so I could include it into MOD package.

103
Mods & Plugins (Releases & Support) / [Mod] User upload limits
« on: May 19, 2003, 05:44:23 PM »
Quote from: Bomba
but i would like to add this "how many time to next upload" code in my current mod.  will this work?

why don't you just try?  :lol:

104
Mods & Plugins (Releases & Support) / Re: [Mod] Photo Of The Day
« on: May 19, 2003, 09:01:13 AM »
Quote from: artpapa
Is there any opportunity to display "Photo Of The Day" outside of gallery folder in the static HTML files?

You should combine two MOD's for this: install Random Image MOD and then change it's original SQL query to the query from this MOD

105
Quote from: Shap
Is this a bug or just a problem I'm having?

I know 20+ galleries using this Mod... So, is it a bug or your problem?  :lol:  You're providing not enough information to help you...

Pages: 1 ... 3 4 5 6 [7] 8 9 10 11 ... 27