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 ... 21 22 23 24 [25] 26 27
361
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 20, 2003, 11:24:27 PM »
Quote from: ChrisTTian
May I ask you for another 5 min to write me the code please.

I don't have time to make this code clean, but at least it works... :)  feel free clean it up and modify (and post here)
Code: [Select]

<?php

define
&#40;'ROOT_PATH', './4images/'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;

$number_of_new_pics 15;
$days_to_be_new 1;

$new_cutoff time&#40;&#41; - 60 * 60 * 24 * $days_to_be_new;
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;;

$sql "SELECT MAX&#40;cat_id&#41; as max_id FROM ".CATEGORIES_TABLE;
$row $site_db->query_firstrow&#40;$sql&#41;;
$cat_max_id = &#40;!empty&#40;$row['max_id'&#93;&#41;&#41; ? $row['max_id'&#93; &#58; 0;

for &#40;$i = 0; $i <= $cat_max_id; $i++&#41;&#123;

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name
          FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i";
   
$result $site_db->query&#40;$sql&#41;;
   
$row $site_db->fetch_array&#40;$result&#41;;
    
$images_in_category $site_db->get_numrows&#40;$result&#41;;

   
$category_name = &#40;$row['cat_name'&#93;&#41;;
   
$category_id = &#40;$row['cat_id'&#93;&#41;;
    
$category_link = &#40;"<a href=\"" . ROOT_PATH . "categories.php?cat_id=" . $category_id . "\">"&#41;;

if &#40;$images_in_category&#41; &#123; echo "Found <b>$images_in_category</b> new images in category <b>$category_name</b>&nbsp;&nbsp;&nbsp;$category_link ...view category </a><br>"; &#125;

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name
          FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON u.user_id = i.user_id
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i
          ORDER BY i.image_date DESC
          LIMIT 
$number_of_new_pics";

   
$result $site_db->query&#40;$sql&#41;;
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
   
$image_name = &#40;$row['image_name'&#93;&#41;;
   
$image_id = &#40;$row['image_id'&#93;&#41;;
   
$category_name = &#40;$row['cat_name'&#93;&#41;;
   
$user_name = &#40;$row['user_name'&#93;&#41;;
   
$media_path = &#40;$row['image_media_file'&#93;&#41;;
   
$image_link = &#40;"<a href=\"" . ROOT_PATH . "details.php?image_id=" . $image_id . "\">"&#41;;
   
$allnew_link = &#40;"<a href=\"" . ROOT_PATH . "search.php?search_new_images=1" . "\">"&#41;;

   
echo "<ul><b>$image_name</b> uploaded by <b>$user_name</b>&nbsp;&nbsp;&nbsp;$image_link ...view image </a></ul>";
  &
#125;
&#125;
   
echo "$allnew_link Show all new images? </a>";
?>


362
Mods & Plugins (Releases & Support) / [Mod] Photo Of The Day
« on: January 20, 2003, 03:43:44 PM »
Quote from: widgit1981
Is there any way of displaying the full size image as photo of the day?

Not a big problem, but I can't even imagine, how this would fit any site design  8O

364
Mods & Plugins (Requests & Discussions) / Re: [request mod] myProfile
« on: January 20, 2003, 08:54:04 AM »
Quote from: firlama
the following options would be cool :
- 2 images to upload per user

already done: http://www.4homepages.de/forum/viewtopic.php?t=3607
Quote from: firlama
- extra info about the user, something like a huge ASL

I think, it's not a big deal to add additonal user profile fields... Bearinig in mind, that phpBB integration is one of the most popular issues here, probably it makes sense to make exactly the same user profile fields in 4images.

In general, I don't really understand, what kind of modifications you need  :roll:

365
Mods & Plugins (Releases & Support) / Re: Please help.
« on: January 19, 2003, 01:25:41 AM »
Quote from: wishx
Can anyone help with this? Please?


Just an idea... why don't you try to play with <meta http-equiv="refresh" content="5;URL=next_image_url"> ? Please don't ask me how, if it doesn't work - forget it  :)

366
Mods & Plugins (Releases & Support) / [Mod] User upload limits
« on: January 19, 2003, 01:06:19 AM »
Quote from: Vraxor
Is this a limit for ever, or just a dailly limit. I need a dailly limit as people might upload as much as they want but no more the 3 per day, is there a way to do that with this mod?


At least not now. The number of uploads information is not stored in the database, so there's no way now to check this value. New DB field have to be added and checked before uploads.

This MOD sets the absolute number of permited uploads for every user. The default value is taken from gallery config. This default value and individual limit for any user can be edited via admin control pannel.

When I have some more free time, I see what I can do to add the feature you wanted...

367
Mods & Plugins (Requests & Discussions) / Re: Watermark on images
« on: January 19, 2003, 12:50:37 AM »
Quote from: chessphotos
Is there a mod or template that will allow me to have the © watermark show on all non-thumbnails until download.


I'm working on such MOD now. It gonna be not a watermark, but an image annotation, added to the image automatically, immediately after user upload. At least ImageMagic and GD can do such things.

Hopefully, I could post it here in a week or something...

368
Quote from: sorestar
Can you show me how to set, so that it only randomize certain categories?

Try to play with this query:
Code: [Select]
$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."";

... adding something like AND b.cat_id !='2' AND b.cat_id <'4'

369
Mods & Plugins (Requests & Discussions) / Quick code....
« on: January 17, 2003, 10:20:25 PM »
It's not a real MOD, it's written right now, in five minutes... I hope you can do what you want out of it...
Code: [Select]
<?php

define
&#40;'ROOT_PATH', './'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;;
$number_of_news 5;

$sql "SELECT i.image_name, i.image_date, c.cat_name, u.user_name
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN &#40;
$cat_id_sql&#41; AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_date DESC
        LIMIT 
$number_of_news";
$result $site_db->query&#40;$sql&#41;;
$new_images_list = array&#40;&#41;;
$i 1;
while &
#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
  
$new_images_list[$i&#93; = $row;
  
$i++;
&
#125;
$site_db->free_result&#40;&#41;;

for &#40;$i = 1; $i <= $number_of_news; $i++&#41; &#123;
  
if &#40;isset&#40;$new_images_list[$i&#93;&#41;&#41; &#123;

$image_date format_date&#40;$config['date_format'&#93;." ".$config['time_format'&#93;,$new_images_list[$i&#93;['image_date'&#93;&#41;;
$news = &#40;"new image <b>" . $new_images_list[$i&#93;['image_name'&#93; . "</b> in the category <b>" . $new_images_list[$i&#93;['cat_name'&#93; . "</b> uploaded by <b>" . $new_images_list[$i&#93;['user_name'&#93; . "</b> on <b>" . $image_date . "</b><br>" &#41;;

echo $news;

  &
#125;
&#125;
?>


As a result of this I see:

new image Gala in the category Girlz uploaded by SLL on 17.01.2003 01:13
new image Natasha in the category Girlz uploaded by SLL on 17.01.2003 01:11
new image Boris in the category Boyz uploaded by SLL on 17.01.2003 00:59
new image Dmitry in the category Boyz uploaded by SLL on 17.01.2003 00:59
new image Sergey in the category Boyz uploaded by SLL on 17.01.2003 00:56

Jost edit your homepage and insert <?php include("this_filename.php"); ?> in the proper place. I hope this is what you wanted :wink:

370
Mods & Plugins (Releases & Support) / Re: :-) Thanx for the MOD
« on: January 17, 2003, 09:39:29 AM »
Quote from: heiko
Allerdings mußte ich folgende Modifikation vornehmen, da ansonsten der Link zum Bild  in der Bestätigungsmail (bei erfolgreicher Freigabe) nicht korrekt wiedergegeben wird.


Well... I'm a bit confused myself  :roll:

Theoretically you're right, but if I do it this way, I've got double slash in this link... I've checked it on my local test gallery (OMHIhttpd with WinPHP), and then on my running gallery (Apache, Linux) - in both cases my first code works fine.

So, I believe, this is up to this MOD users to experiment, which of the varians of this line will works for them.

BTW, could you please email me the German text for these templates? I'll include it in the code. Also, if somebody could correct my silly English up there in the templates, that would be also good  :)

371
Mods & Plugins (Releases & Support) / [Mod] User upload limits
« on: January 16, 2003, 11:56:58 PM »
Quote from: widgit1981
Where do I do that ? Can you do the code for it ? Im no php coder


I'm not a PHP coder either  :lol:

I'm just running 4images gallery for IRC network users. I've tested more than 15 different image gallery scriprs, and found 4images much better than others. But, there still some features are missing, that's why I'm modifying it according to my needs.

I'm not sure that I'm good enough in PHP programming to make MOD requested by you... sorry...

372
I've made this small MOD on my users request. They were waiting for their photo validation, without knowing if it was declined. The idea and some code are from Vraxor (mail on comments MOD).
Code: [Select]
#############################################################################################
## Title: Email image validation results to the user
##        for 4images - Image Gallery Management System.
##
## Version: 1.0
## Author: Silly Little Lamer <sll@dalnet.ru>
## Description: This Mod sends the email to the users, informing them if uploaded
## image(s) were validated or declined by the Administrator of the Gallery.
##        Email being sent only to the users, which have "Receive emails from
## administrators" set "on"
##
## Installation Level: Easy
## Installation Time: 5 Minutes
##
## Files To Edit: 1
## /4images/admin/validateimages.php
##
#############################################################################################
download: http://faces.dalnet.ru/files.php?id=7&l=english

373
Mods & Plugins (Releases & Support) / [Mod] User upload limits
« on: January 16, 2003, 02:24:46 PM »
Quote from: widgit1981
My idea is that a medium sized image is on but it limits you to the full size image which is available via the download button.


I see... well, you could try to do exactly the same thing, as my MOD doing. Just add more fields to database and check download button instead of upload..

374
Mods & Plugins (Releases & Support) / [Mod] User upload limits
« on: January 16, 2003, 12:02:21 PM »
Quote from: widgit1981
Maybe with this code someone will be able to do the same for download limits and change limits per user ?


Unfortunately, it's absolutely useless to protect images downloads this way. To understand why, try to set "Scripting -> Disable" in your web browser, then go any image in your gallery, press right mouse button and select "Save Picture As..."

375
Quote from: sorestar
can you post the completed script here, please?


OK, to make our life easier, below are three scripts running on the homepage of my site:

    - one to show random image from 4images gallery;
    - one to fetch last few topics from phpBB board;
    - one to fetch some stats from phpBB board;
    [/list:u]
The code is not mine! I just modified it a bit and have managed scripts to work on the same page.

Save this one as random.php
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;;

define&#40;'PIC_CATEGORIES_TABLE', '4images_categories'&#41;;
define&#40;'PIC_IMAGES_TABLE', '4images_images'&#41;;
define&#40;'THUMB_DIR', 'data/thumbnails'&#41;;
define&#40;'AUTH_ALL', 0&#41;;
define&#40;'AUTH_USER', 2&#41;;
define&#40;'AUTH_ACL', 3&#41;;
define&#40;'AUTH_ADMIN', 9&#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;

$sql "SELECT COUNT&#40;*&#41; 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&#40;$sql&#41;;
$total_images $row['total_images'&#93;;

mt_srand&#40;&#40;double&#41;microtime&#40;&#41; * 1000000&#41;;
$number = &#40;$total_images > 1&#41; ? mt_rand&#40;0, $total_images - 1&#41; &#58; 0;

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments 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." LIMIT $number, 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 
"&raquo; <a target=\"a\" href=\"".SITE_URL."\">âñåãî â àëüáîìå <b>$total_images</b> ôîòî</a><br>\n";
?>


Save this one as recent.php
Code: [Select]
<?php
define
&#40;'IN_PHPBB', true&#41;;

$limit "7"// how many topics to fetch?

$phpbb_root_path "./phpBB2/";
$phpbb_main_url "http&#58;//forum.dalnet.ru/";
include_once&
#40;$phpbb_root_path . 'extension.inc'&#41;;
include_once&#40;$phpbb_root_path . 'common.'.$phpEx&#41;;

$recent_sql "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " TOPICS_TABLE " WHERE forum_id !='3' AND forum_id <'8' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent $db->sql_query&#40;$recent_sql&#41;;

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

while &
#40;$line = mysql_fetch_array&#40;$recent&#41;&#41; &#123;
$security=FALSE;
if&
#40;$forum_auth == 2 && $userdata['user_level'&#93; == ADMIN&#41; &#123;
$security=TRUE;
&
#125;
if&#40;$forum_auth == 3 && &#40;$userdata['user_level'&#93; == ADMIN&#41; || &#40;$userdata['user_level'&#93; == 2&#41;&#41; &#123;
$security=TRUE;
&
#125;
if&#40;$forum_auth == 0&#41; &#123;
$security=TRUE;
&
#125;
if&#40;$security == TRUE&#41;
&#123;
  
$lastpost_array=$db->sql_query&#40;"SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id'&#93;&#41;;
  
$lastpost=mysql_fetch_array&#40;$lastpost_array&#41;;
  
$lastpost=$lastpost['post_time'&#93;;
  
$lastpost=create_date&#40;"d M - H&#58;m", $lastpost, $board_config['board_timezone'&#93;&#41;;

  
$j stripslashes&#40;$line['topic_title'&#93;&#41;;
  
$k substr&#40;$j, 0, 35&#41; . "...";

  
echo "<tr><td class=\"menutext\" align=\"left\">&raquo; <a target=\"f\" href=\"$phpbb_main_url"viewtopic.php?t=" $line['topic_id'&#93; . "\" class=\"menutext\">" . $k . "</a></td>";
  
echo "<td class=\"ltgreytext\" align=\"right\">$lastpost</td></tr>";

&
#125;&#125;;
echo "</table>";
?>


Save this one as phpbb_fetch_info.php
Code: [Select]
<?php
$phpbb_root_path 
'./phpBB2/';
define &#40;'IN_PHPBB', true&#41;;

include&#40;$phpbb_root_path . 'extension.inc'&#41;;
include_once&#40;$phpbb_root_path.'config.'.$phpEx&#41;;
include_once&#40;$phpbb_root_path.'includes/db.'.$phpEx&#41;;
include_once&#40;$phpbb_root_path.'includes/constants.'.$phpEx&#41;;

function phpbb_fetch_stats&#40;&#41;
&#123;
    
global $db;

    
$result = array&#40;&#41;;
    
$result['total_posts'&#93; = get_db_stat&#40;'postcount'&#41;;
    
$result['total_users'&#93; = get_db_stat&#40;'usercount'&#41;;
    
$newest_user           get_db_stat&#40;'newestuser'&#41;;
    
$result['user_id'&#93;     = $newest_user['user_id'&#93;;
    
$result['username'&#93;    = $newest_user['username'&#93;;

    
$sql 'SELECT session_id FROM ' SESSIONS_TABLE ' WHERE session_time >= ' . &#40;time&#40;&#41; - 300&#41;;
$query $db->sql_query&#40;$sql&#41;;
$user_online $db->sql_fetchrow&#40;$query&#41;;

$result['user_online'&#93; = count&#40;$user_online&#41;;
echo "$table_prefix\n<br>";

    return 
$result;
&
#125;
?>


Then open your index.php and insert the following tags into the proper places:
Code: [Select]
<?php
include&#40;'phpbb_fetch_info.php'&#41;;
$stats phpbb_fetch_stats&#40;&#41;;
echo 'Total posts&#58; ' $stats['total_posts'&#93; . ', total users&#58; ' . $stats['total_users'&#93; . ', now online&#58; ' . $stats['user_online'&#93; . ', last registered&#58; ' . $stats['username'&#93;;
?>


<?php include&#40;"recent.php"&#41;; ?>
<?php include&#40;"random.php"&#41;; ?>


Demo: http://www.dalnet.ru/home.php

Pages: 1 ... 21 22 23 24 [25] 26 27