Author Topic: [MOD REQ] Last updated profile - NewsFeed  (Read 7582 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
[MOD REQ] Last updated profile - NewsFeed
« on: November 28, 2007, 01:59:51 PM »
MOD REQ: Last updated profile

Just idea if anyone is willing to make it ;)
« Last Edit: March 06, 2008, 10:53:48 AM by Lucifix »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD REQ] Last updated profile
« Reply #1 on: November 28, 2007, 02:08:07 PM »
And where for see last update profile ? (Index, member) ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile
« Reply #2 on: November 28, 2007, 02:14:28 PM »
And where for see last update profile ? (Index, member) ?

Maybe in left block on every page. But primary on index / home.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD REQ] Last updated profile
« Reply #3 on: November 29, 2007, 01:08:50 AM »
Hum ... I no like public for this ... if post in buddy list MOD topic ... is possible for add for friends. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile
« Reply #4 on: November 29, 2007, 08:50:10 AM »
Yes, maybe it would be even better if you recive profile notification just for your friends in buddy list. Great idea!  :wink:

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile
« Reply #5 on: March 06, 2008, 10:53:34 AM »
@thunderstrike: anything new about this mod? :roll:

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile - NewsFeed
« Reply #6 on: August 05, 2008, 01:36:43 PM »
If someone is willing to do this mod for money, plz let me know.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile - NewsFeed
« Reply #7 on: August 20, 2008, 02:31:28 PM »
If anyone is interesting in NewsFeed MOD, here is something that I made. It will show you lates updates from you friends:
- update when you friend has uploaded image
- update when you friend has post a comment

If you want to use this mod, you'll need to install [MOD] Buddy List || Friend List from ccsakuweb:
http://www.4homepages.de/forum/index.php?topic=17491.0

Create file newsfeed.php
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: newsfeed.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    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.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'newsfeed';

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

$sql_friends "SELECT *
        FROM "
.USERS_TABLE."
        WHERE user_id = "
.$user_info['user_id']."";
$friends_row $site_db->query_firstrow($sql_friends);

// CHECK IF USER HAS FRIENDS / [MOD] Buddy List || Friend List (ccsakuweb) http://www.4homepages.de/forum/index.php?topic=17491.0
  
if (!empty($friends_row['user_friend_ids'])) {
    
$split_keywords explode(" "$friends_row['user_friend_ids']);
    foreach ($split_keywords as $key => $val) {
$sql1 "SELECT *
        FROM "
.USERS_TABLE."
        WHERE user_id = 
$val
ORDER BY user_name ASC"
;
$friends_name $site_db->query_firstrow($sql1);
$fname $friends_name['user_id'];

// USER HAS PUBLISHED PHOTO
$sql_image "SELECT i.image_id, i.image_date, i.user_id, i.image_name, u.user_id, u.user_name FROM ".IMAGES_TABLE." i, ".USERS_TABLE." u WHERE u.user_id = i.user_id AND i.user_id = $fname AND i.image_date > UNIX_TIMESTAMP() - $time";
$image_row $site_db->query_firstrow($sql_image);
if (!empty($image_row)) {
$image_date format_date($config['date_format']." ".$config['time_format'],$image_row['image_date']);
$newsfeed .= "<div style=\"padding: 2px\"> <strong><a href=\"/member.php?action=showprofile&user_id=".$image_row['user_id']."\" class=\"nickname\" >".$image_row['user_name']."</a></strong> has published photo <strong><a href=\"/details.php?image_id=".$image_row['image_id']."\">".$image_row['image_name']."</a></strong>. Date: <strong>$image_date.</strong></div>";
}

// USER HAS COMMENTED PHOTO
$sql_comment "SELECT c.user_id, c.comment_text, c.user_name, c.image_id, c.comment_date, i.image_id, i.image_name FROM ".COMMENTS_TABLE." c, ".USERS_TABLE." i WHERE c.image_id = i.image_id AND c.user_id = $fname AND c.comment_date  > UNIX_TIMESTAMP() - $time ORDER BY c.comment_date DESC";
$result $site_db->query($sql_comment);
while($comment_row mysql_fetch_array($result)){
if (!empty($comment_row)) {
  $doit $comment_row['comment_text']; 
 
  $max70//NUMBER OF LETTERS TO SHOW
          $modstr1=((strlen($doit)>$max)?substr($doit,0,$max) . "..." $doit);

$comment_date format_date($config['date_format']." ".$config['time_format'],$comment_row['comment_date']);
$newsfeed .= "<div style=\"padding: 2px\"> <strong><a href=\"/member.php?action=showprofile&user_id=".$comment_row['user_id']."\">".$comment_row['user_name']."</a></strong> has commented image <strong><a href=\"/details.php?image_id=".$comment_row['image_id'].".html\">".$comment_row['image_name']."</a></strong>.<br><span style=\"padding-left: 20px;font-size: .85em;color: #939393;\">$comment_date</span><br />".$comment_row['comment_text']."</div>";
}
}
}

$site_template->register_vars(array(
  
"msg" => $msg,
  
"newsfeed" => $newsfeed
));
$site_template->print_template($site_template->parse_template($main_template));

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

?>

Create new template newsfeed.html and insert this code:

Code: [Select]
{header}
<table width="640" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td colspan="4"><img src="{template_url}/images/header_top.gif" width="640" height="6" alt="" /></td>
        </tr>
        <tr>
          <td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" /></td>
          <td width="405"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" /></td>
          <td width="225" align="right">
            <form method="post" action="{url_search}">
              <table border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
          </td>
          <td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bordercolor">
      <table width="640" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="638" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="636" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right">
    <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
  </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="638" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" class="row2" valign="top">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
  {if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
    <br />
                        {random_image}
<br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
  {endif random_image}
                </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
                <td width="450" valign="top">
  <br />
                  <span class="title">{lang_control_panel}</span>
                  <hr size="1" />
                  {if msg}<b>{msg}</b><br /><br />
                  {endif msg}
  {newsfeed}
  <p>&nbsp;</p>
</td>
                <td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6"><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" /></td>
          <td width="405">&nbsp;</td>
          <td width="225">&nbsp;</td>
          <td width="6"><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}

I suggest you to test this MOD first before you make it public, because I'm not sure how will work in you gallery.

There is one problem, I don't know how could I sort all feed by date. Does anyone has any idea?

« Last Edit: August 20, 2008, 02:45:20 PM by Lucifix »

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Last updated profile - NewsFeed
« Reply #8 on: August 20, 2008, 02:54:36 PM »
And if this MOD will work I can post few more modifications:
- update when did your friend last log in
- update when your friend has added another member to friend list
- or update when your friend has beed added to friend list by another member