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 - trez

Pages: [1] 2 3 4 5 ... 41
1
Chit Chat / I am back ; )
« on: October 01, 2014, 06:45:59 AM »
Hi there,

good to see that 4images is still alive and kickin', even though there is nothing new released since 2012. I was missing for over two years!  :D

Anyway, for a new project of mine I decided to use 4images again instead of wordpress, so I guess you guys will see soon a template which is
responsive, has all those notifications etc, or let's just call it modern. It goes into the 500px direction in terms of user management and style. 
I will also start offering support for my mod's again, so if anyone has a problem with my mod's just shout me a PM or mail.

Feels good to be back in the family again ^^

George

2
hi,
another little problem..
if the image name is e.g. "shop's" the activity are not save in the database..
anybody else here with the same problem?
Thanks Loda


I will fix that tomorrow, thanks for pointing it out. have to use "stripslashes()" more often ;)

3
Wow i really like your ideas. To make 4images more comfortable for users. Very very nice.
I really would like to see how this mod works.
And i'm also very tense how your theme looks if it's finished:)

Regards
Crazymodder

Thanks,

Thanks. Live version goes online soon and I will post a link when it's done ; )

4
yeah, db cache. Caching the results of the queries ;)

If it's working on every browser - then your solution is right :) If not write e a PM and i'll test it

5
you dont afraid of slow down site with high rate visits?

No, 4images is fast if you don't install "wrong" mod's that do big queries. I am also caching almost everything.
4images can handle 1000+ simultaneous users without any problem if your code is good and cache is enabled.  


Big minus is calculating winner list every page load (generating unnecessary DB load)

Cache it :) I am using that block only on the mainpage, where I have only 6 queries, so it makes no problems.

For me better solution is periodically generating actual 'winner list' - via cron or by user visit every 15minut or sth else...

It's something very different but yes, you are right. I would do the cron every one week and then show the (fixed) result e.g. winners for past week, querying only a handful of rows.

i tested your solution with css overlaing text on thums... it is problem with IE...
it needs "left: 0px;" in CSS .imgteaser a:hover .desc   or you know better solve.

Is it working? I don't have trouble with IE7, don't know about future versions 'cause I hate that browser : )



6
Still working on some modifications to make it better. I see that another two people downloaded the files - please give me a little feedback if everything works, do't just leech the files and say nothing (!)

7
great job!
what next?  :-)

how you count "likes" - as lightbox adds?

With an additional field in the images_table. Just set a new field and add an sql in page_header to update it (+1/-1) on adding and deleting images from/to lightbox.

---------------------------------------------------------

On a very visited site, you get thousands of pictures every month. I wanted my user so show the very best for the past 7 days, so I did a simple mod called "Weekly TOP".
It takes all the images (uploaded in the past 7 days) and shows only images with a high count of activity. For example votes + lightboxcount , or rating + comments. You can modify it
to what you want (accessing fields in the image table).

For example, if we want to show images with 20 "actions" including comments and votes the line used would look like this:
Code: [Select]
AND (i.image_votes + i.image_comments) > 20
Or show pictures that have at least 5 comments and at least 5 votes by doing this:
Code: [Select]
AND i.image_votes > 5 AND i.image_lightboxcount > 5
Now, we need to do the cutoff (for the time). For example if you want to show the weekly top images for the past 7 days it would look like this:
Code: [Select]
$new_cutoff = time() - 60 * 60 * 24 * 7;

7 is days. Replace it with 14, to get the images for the past 2 weeks and so on. You can of course show a weekly top, a monthly top and a yearly top.
It's a great way to show off your best new images on the site.  For example like in this screenshot, showing the module on my site:




If someone has interest in me publishing a MOD about all this just tell me.


8
Discussion & Troubleshooting / Re: Thumbnail doesnt create
« on: November 02, 2011, 02:36:09 PM »
There can be several reasons:

Check this:

http://www.4homepages.de/forum/index.php?topic=28931.msg155188#msg155188

If that doesn't help:

1) Did you try to switch to another conversation tool for thumbnails?  (ACP --> General Settings) - By default it's GD, but maybe your webserver isn't supporting it. Try with imagemagic, or netPBM.

9
Please PM  me a link with test account to your site so I can have a look at it

10
I released yesterday a MOD witch notify's users of any activity concerning their images.
You can find the MOD here: [developing] Notifications & User Activity v0.1

To be honest, it really sucks with the standard template, but if  you are heavily customizing your site (I assume it, because you read this thread) it will look pretty good, if you
give it a little try. I attached a screenshot of what i mean.

PS: If you are wondering about the karma/rank etc - that's another custom mod I will publish maybe next week.

11
Did you install also [MOD] Lightbox for GUESTs v1.2 MOD ? And what version of 4images are you using?

12
Please give me a link to your Mulilightbox MOD, so I can see if I can solve your problem (there are many MOD's).

13
A little error on my site...
the thumb in the notification is broken..
it's the tag : {what_pic}
i don't know why..

are your files stored in the default folder from the userpic mod, and is the file a JPG ? Your userpics have to look like this:
http://yourdomain.com/4images/data/userpic/1.jpg

PS: The MOD assumes that all your userpic's are "*.jpg" files. If needed just convert them, and forbid uploading of other files than jpg - at least I did it so.


14
Okay, I think the name of the MOD speaks for itself. I wasn't considering sharing it since I worked a lot on it, but since I love the 4images community I decided to share it and develop it further.
Please keep in mind that this is v0.1 of the MOD - I will release v0.2 soon (after getting some feedback of you).


WHAT

This MOD created something like the notification feed on facebook. If user A comments, votes or add's a photo of user B, user B will get notifications (on the site, not by mail).
A "New Notifications" - count is displayed in the user login info, showng your unseen notifications. After you click on it (and see your new notifications) this number is being reset
(like on facebook) automatically - you don't have to click on anything to mark a notification as read (unlike other similar mod's to mine) . You can browse old notifications.
Please see attached screen-shots to get a feeling (at the end of this topic) (last screenshot is how it can look like with a little customization).

This MOD put's everything that happens to your user's pictures into one place.




WARNING
1) This is the first release - I tested it, but it can contain bug's . Please post if you have any problems, I tested it with 4images 1.7.10 and PHP5.
2) I didn't use language tags, because I am too lazy to do it. If you want to use language tags you can add them yourself.
3) This MOD won't work properly with guests (at least I didn't test it)
4) The MOD assumes that all your userpic files are "*.jpg" - please check your upload settngs (for userpic) and don't allow other file types (only for userpicture)


NEEDED MODS

This MOD supposes you installed V@no's [MOD] Member personal photo v1.1.3. If you want to use my MOD without it with, you can, but it just looks better with it.

Please make sure that you did the step's required to add default user-image, if no user-image is uploaded (otherwise you'll get broken images)


NOTE
The way I did this MOD is certainly not perfect, but it works for the purpose of my website. Please be patient for the User Activity Feed, as of right now I am only uploading the Notification part.


FIXES

31.10.2011 - fixed comment formatting, please do STEP 9  
31.10.2011 - fixed getting notifications when commenting on own pictures, please redo STEP 4 (code updated).  






==================================================================

Okay, be sure to make a backup of your database and your files that are being changed.


STEP 1

run this query in your php-my-admin:

Code: [Select]
CREATE TABLE IF NOT EXISTS `4images_notifications` (
  `id` int(12) unsigned NOT NULL AUTO_INCREMENT,
  `from_id` int(10) unsigned NOT NULL DEFAULT '0',
  `to_id` int(10) unsigned NOT NULL DEFAULT '0',
  `from_username` varchar(255) NOT NULL,
  `to_username` varchar(255) NOT NULL,
  `what_pic` varchar(255) NOT NULL,
  `text1` varchar(255) NOT NULL,
  `text2` varchar(255) NOT NULL,
  `text3` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `content_link` varchar(255) NOT NULL,
  `date` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `from_id` (`from_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;



then, run this sql in your php-my-admin:

Code: [Select]
ALTER TABLE `4images_users` ADD `user_notify` int(10) NOT NULL DEFAULT '0'



==================================================================

STEP 2

open includes/constants.php

find:
Code: [Select]
define('WORDMATCH_TABLE', $table_prefix.'wordmatch');

add below
Code: [Select]
define('NOTIFY_TABLE', $table_prefix.'notifications');


==================================================================

STEP 3

open includes/functions.php


//including FAVORITES (LIGHTBOX) to be shown

find:
Code: [Select]
if (!in_array($id, $lightbox_array)) {

add below:
Code: [Select]

//activity
    $sql = "SELECT cat_id,image_media_file,image_name, image_id, user_id
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1 AND image_id = $id";
 $result = $site_db->query_firstrow($sql);
 $cat = $result['cat_id'];
          $media = $result['image_media_file'];
          $name = $result['image_name'];
 $image_id = $result['image_id'];
 $user_id = $result['user_id'];

        $sql = "INSERT INTO " . NOTIFY_TABLE . "
        (id, from_id, to_id, from_username, to_username, what_pic, text1, text2, text3, content, content_link, date)
        VALUES(NULL, '".$user_info['user_id']."', '" . $user_id . "', '".$user_info['user_name']."', '', '".$cat."' '/' '".$media."', 'added', '".$name."', 'as a favourite', '', 'details.php?image_id=' '".$image_id."', '" . time() . "')";
   $site_db->query($sql);


$sql = "UPDATE ".USERS_TABLE."
SET user_notify=user_notify+1 WHERE user_id = ".$user_id;
$site_db->query($sql);
//activity


//now we are including the rating to be shown


find:
Code: [Select]
function update_image_rating($image_id, $rating) {
  global $site_db;
  $sql = "SELECT cat_id, image_votes, image_rating


replace with:
Code: [Select]
function update_image_rating($image_id, $rating) {
  global $site_db, $user_info;
  $sql = "SELECT cat_id, image_votes, image_rating, user_id, image_media_file, image_name, image_id


find:
    
Code: [Select]
$new_rating = sprintf("%.2f", $new_rating);
insert below:
Code: [Select]
$rating_value = $rating;

find:

Code: [Select]
   $sql = "UPDATE ".IMAGES_TABLE."
            SET image_votes = ($old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = $image_id";
    $site_db->query($sql);



add below:
Code: [Select]

//activity
 $cat = $image_row['cat_id'];
 $to_id = $image_row['user_id'];
          $media = $image_row['image_media_file'];
          $name = $image_row['image_name'];
 $image_id = $image_row['image_id'];
 $user_name = $user_info['user_name'];

$sql = "UPDATE ".USERS_TABLE."
SET user_notify=user_notify+1 WHERE user_id = ".$to_id;
$site_db->query($sql);  

   $sql = "INSERT INTO " . NOTIFY_TABLE . "
        (id, from_id, to_id, from_username, to_username, what_pic, text1, text2, text3, content, content_link, date)
        VALUES(NULL, '".$user_info['user_id']."', '$to_id', '$user_name', '0', '".$cat."' '/' '".$media."' , 'rated', '".$name."', 'with' ' ' '<b>' '$rating_value' '</b>' , '', 'details.php?image_id=' '".$image_id."', '" . time() . "')";
   $site_db->query($sql);
 //activity



==================================================================

STEP 4

open details.php (or ajaxcomments.php if you installed THIS MOD)

find:
Code: [Select]
update_comment_count($id, $user_info['user_id']);

add below:

Code: [Select]

 //activity
    $sql = "SELECT cat_id,image_media_file,image_name, image_id, user_id
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1 AND image_id = $id";
 $result = $site_db->query_firstrow($sql);
 $cat = $result['cat_id'];
 $to_id = $result['user_id'];
          $media = $result['image_media_file'];
          $name = $result['image_name'];
 $image_id = $result['image_id'];

if ($user_info['user_id'] != $result['user_id']) {    
 
$sql = "UPDATE ".USERS_TABLE."
SET user_notify=user_notify+1 WHERE user_id = ".$to_id;
$site_db->query($sql);  
 
   $sql = "INSERT INTO " . NOTIFY_TABLE . "
        (id, from_id, to_id, from_username, to_username, what_pic, text1, text2, text3, content, content_link, date)
        VALUES(NULL, '".$user_info['user_id']."', '$to_id','$user_name', '0', '".$cat."' '/' '".$media."' , 'commented', '".$name."', '', '$comment_text', 'details.php?image_id=' '".$image_id."', '" . time() . "')";
   $site_db->query($sql);

}

 //activity



==================================================================

STEP 5

open includes/page_header.php

find:
 
Code: [Select]
"rss_url" => "",
add below:
Code: [Select]
"sess_user_notify" => $user_info['user_notify'],


==================================================================

STEP 6

open your_template/header.html


find:
Code: [Select]
» <a href="{url_control_panel}">{lang_control_panel}</a><br />
add below:

Code: [Select]
» Notifications <a href="notifications.php?action=new">{sess_user_notify}</a><br />


==================================================================

STEP 7

Upload notifications.php to your 4images root folder
Upload member_notifications.html, member_notifications_bit.html and member_notifications_new.html to your 4images template folder

Files are attached to this post.



==================================================================

STEP 8
Do some testing. If everything works (yeah, it will) start customizing the *.html files to your personal design.



---------------------------------------------------------------------------------------

STEP 9 - FIXES

a - fix comment formatting (bbcode etc).
open notifications.php and find:

Code: [Select]
"content" => $content,

replace with:
Code: [Select]
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),

---------------------------------------------------------------------------------------



PLANNED FOR V0.2
- icons for each different notification
- activity wall
- paging for old notifications
- fix own notifications (when commenting own image) --- DONE
- support for guestbooks and various other MOD's




15
Great, thanks, that will help me ;)

Pages: [1] 2 3 4 5 ... 41