SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 22, 2012, 01:45:04 pm

Login with username, password and session length
Members
Total Members: 10066
Latest: khoeidong
Stats
Total Posts: 28682
Total Topics: 4975
Online Today: 87
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 1
Guests: 51
Total: 52
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Notify ALL of new Comments  (Read 7190 times)
Rafferty
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 158



View Profile WWW
« on: September 25, 2007, 06:41:42 pm »

First of all, xlant program SMFHacks, well done. The pro gallery without doubt is the most popular section on my forum.

My members delight in placing up photos and commenting on others. This is my dilemma, a lot of my members are asking to be be notified, not only on their own photos, but ALL photos when a new comment has been posted. Is there a way of doing this, the new photo post notification is a great idea, can this be extended to include new comments on all posted photos?

Regards

Rafferty
« Last Edit: September 25, 2007, 06:43:33 pm by Rafferty » Logged

Don't Follow Me I Have No Idea What I'm Doing
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #1 on: September 25, 2007, 06:46:19 pm »

Currently this is not built in.

Are the members looking to get notified when a new picture is added to a category.

Or get notified only on comments made to a specific picture.
Logged
Rafferty
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 158



View Profile WWW
« Reply #2 on: September 25, 2007, 06:54:36 pm »

I've already set the photos to auto post in the forum on new photo post, thats working fine, I was referring to the subsequent comments made on them. When a new comment is made on "any" photo, their asking to have some form of notification of the new comments
Logged

Don't Follow Me I Have No Idea What I'm Doing
Vincent Volmer
Community Suite Customer
Sr. Member
******
Offline Offline

Posts: 464


SMF 2.0.1


View Profile WWW
« Reply #3 on: November 02, 2007, 03:19:23 am »

Maybe this could be implemented (see image below).

Next to the total amount of comments, the amount of new comments in a different colour (box). Users can see on the tumbnail page which pictures have new comments. I think this should be 'private'. The member sees it only for 'his/her' imaages it selves..

Vincent.



« Last Edit: February 24, 2010, 02:33:46 am by Vincent Volmer » Logged

spurry
Newbie
*
Offline Offline

Posts: 29


View Profile
« Reply #4 on: January 25, 2008, 03:49:49 pm »

good idea did this ever come off?
Logged
Rafferty
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 158



View Profile WWW
« Reply #5 on: January 25, 2008, 04:16:15 pm »

I was thinking more of new comments being posted similar to recent posts on the main smf index page, although that looks great, how would that be implemented?
Logged

Don't Follow Me I Have No Idea What I'm Doing
Vincent Volmer
Community Suite Customer
Sr. Member
******
Offline Offline

Posts: 464


SMF 2.0.1


View Profile WWW
« Reply #6 on: July 25, 2008, 01:32:18 am »

Any news on this topic? Would be very nice.... when this could be implemented...

Vincent
Logged

Vincent Volmer
Community Suite Customer
Sr. Member
******
Offline Offline

Posts: 464


SMF 2.0.1


View Profile WWW
« Reply #7 on: August 27, 2008, 01:22:15 am »

Will this be added to Gallery 1.4 ?

Vincent
Logged

calumbo
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #8 on: October 13, 2008, 04:32:36 pm »

I implemented this feature as a Tinyportal Block (I edited the code provided by Thurnok)

Code:
////////////////////////////////////////////////////
// SMF Gallery Most Recently Commented Picture Block //
////////////////////////////////////////////////////
//
// Originally
// Developed by Thurnok
// Thurnok -AT- tinyportal .DOT. net
// November 30, 2006
// Edits Made By Calum Brodie
//
// Updated 9/26/2008
// 1.8
// - added display # of comments option
//
// Used in a TinyPortal phpblock or Article.
// This block displays Most Recently commented from
// the SMF Gallery mod along with other information
//
//////////////////////////////////////////////

global $scripturl, $db_prefix, $modSettings, $boardurl, $ID_MEMBER, $user_info, $context;

/*
****************************************
****************************************
***    !! Admin Config Section !!    ***
****************************************
****************************************
*/

//   *****   LAYOUT OPTIONS   *****
// how many pictures do you want to show?  0 = all!
$gal_numpics = 6;


// enable profile pics display?
// 0 = disable, 1 = enable --- if enabled, and you are viewing a member profile, show pics from that member only
// other options still apply (showtype, sort order, etc)
$gal_profile = 1;

// only show pics from buddies?
// 0 = disable, 1 = enable --- if enabled, will only show pics posted by members in your buddy list
$gal_buddies = 0;

// use Normal Size Text, or Small Size Text? (0 = Normal Size, 1 = Small Size)
$gal_smalltext = 1;

// put pictures in how many columns?  (1 for left/right block, more for centerblock / article if you wish)
$gal_columns = 1;

// information display flags (0 = No, 1 = Yes)
// display picture title?
$gal_dispTitle = 1;
// display membername who posted pic?
$gal_dispMember = 1;
// display posted date?
$gal_dispDate = 0;
// display category the picture is in?
$gal_dispCategory = 0;
// display number of views?
$gal_dispViews = 0;
// display dimensions?
$gal_dispDimensions = 0;
// display filesize?
$gal_dispSize = 0;
// display picture description?
$gal_dispDescription = 0;
// display # comments
$gal_dispNumComments = 1;

//   *****   SECURITY CONFIGURATION   *****
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
//156 is funny pictures
$gal_disallowCats = "156";
// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";
// Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
$gal_viewPermission = 1;

/*
****************************************
****************************************
***  !! END Admin Config Section !!  ***
****************************************
****************************************
*/

//###############################################
//###############################################
//   You shouldn't change anything below here
//###############################################
//###############################################

if (empty($modSettings['gallery_url'])){
$modSettings['gallery_url'] = $boardurl . '/gallery/';
}

$gal_textclass = empty($gal_smalltext) ? "normaltext" : "smalltext";

// get this user's buddy list
$gal_buddylist = implode(",", $user_info['buddies']);

// prep for our switch routine
if (empty($gal_showtype))
$gal_showtype = 0;

// sort text
if (empty($gal_sort)){
$gal_sort_text = 'DESC';
} else {
$gal_sort_text = '';
}

// are we viewing a member profile and $gal_profile is enabled?
if (!empty($gal_profile) && strtolower($context['current_action']) == "profile"){
$gal_member = empty($_GET['u']) ? $ID_MEMBER : $_GET['u'];
}
$mrc_id_picture = array();
//Custom Code by C Brodie - Get most recently commented ID_CAT's and use them in below query
$most_recent_comments = ' SELECT DISTINCT ID_PICTURE FROM '.$db_prefix.'gallery_comment ORDER BY date DESC LIMIT '.$gal_numpics.'';
$most_recent_comments_result = mysql_query($most_recent_comments);
while ($most_recent_id_picture = mysql_fetch_assoc($most_recent_comments_result)) {
$mrc_id_picture[] = $most_recent_id_picture['ID_PICTURE'];
}

$gal_numpics_count = $gal_numpics;
// allow member to view random pic based on security settings
if (empty($gal_viewPermission) || allowedTo('smfgallery_view')){
$gal_query = '
SELECT
thumbfilename,
ID_PICTURE,
ID_MEMBER,
date,
title,
description,
views,
filesize,
height,
width,
commenttotal,
ID_CAT
FROM '.$db_prefix.'gallery_pic
WHERE approved = 1
'.(empty($gal_member) ? (empty($gal_buddies) ? "" : (empty($gal_buddylist) ? "AND ID_MEMBER = NULL " : "AND ID_MEMBER in ($gal_buddylist)")) : "AND ID_MEMBER = $gal_member" ).'
'.(empty($gal_disallowCats) ? "" : " AND ID_CAT NOT IN ($gal_disallowCats)").'
'.(empty($gal_allowCats) ? "" : " AND ID_CAT IN ($gal_allowCats)").'
AND (';
foreach ($mrc_id_picture as $key => $value){
$gal_numpics_count-- ;
$gal_query .= '(ID_PICTURE = '.$value.')';
if ($gal_numpics_count != 0) { $gal_query .= ' OR ';}
}
$gal_query .= ') GROUP BY thumbfilename ';

$gal_query .= (empty($_GET['gal_viewall']) && !empty($gal_numpics)) ? ' LIMIT '.$gal_numpics : '';
$gal_result = mysql_query($gal_query);
if (!$gal_result){
// error retrieving information from database
if (mysql_errno() == 1146){
echo '<p />Error, no database found!<p />';
} else {
echo '<p />MySQL error:'.mysql_error().'<p />';
}
} else {
echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

$gal_colcnt = 1;
echo " <tr>\n";
while ($row = mysql_fetch_assoc($gal_result)){
if ($gal_colcnt > $gal_columns){
// close out the row and start a new row
echo " </tr>\n <tr>\n".' <td colspan="'.$gal_columns.'"></td>'."\n </tr>\n <tr>\n";
// reset count to column 1
$gal_colcnt = 1;
}
echo ' <td class="'.$gal_textclass.'" align="center">'."\n";
// display title if enabled, make edit link if viewing user is picture poster
if (!empty($gal_dispTitle)){
echo " ".($ID_MEMBER == $row['ID_MEMBER'] ? ('<a href="'.$scripturl.'?action=gallery;sa=edit;id='.$row['ID_PICTURE'].'">'.$row['title'].'</a>') : $row['title'])."<br />\n";
}
// display the picture thumbnail and link it to gallery full picture
echo ' <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a><br />'."\n";
// display poster's name and posted date if enabled
if (!empty($gal_dispMember) || !empty($gal_dispDate)){
echo 'Posted';
if (!empty($gal_dispMember)){
// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';
}
if (!empty($gal_dispDate)){
// display the date it was posted
echo ' on '.date("d M Y", $row['date']);
}
echo "<br />\n";
}
// display category if enabled
if (!empty($gal_dispCategory)){
// get category name based on category id
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT title FROM ".$db_prefix."gallery_cat WHERE ID_CAT = ".$row['ID_CAT']));
echo '<br />in<br /><a href="'.$scripturl.'?action=gallery;cat='.$row['ID_CAT'].'">'.$gal_tmp['title']."</a><br /><br />\n";
}
// display number of views if enabled
if (!empty($gal_dispViews)){
echo "Viewed ".$row['views']." times<br />\n";
}
// display dimensions if enabled
if (!empty($gal_dispDimensions)){
echo $row['width']."w X ".$row['height']."h<br />\n";
}
// display filesize if enabled
if (!empty($gal_dispSize)){
echo $row['filesize']." bytes<br />\n";
}
// display description if enabled
if (!empty($gal_dispDescription)){
echo "<br />".$row['description']."<br />\n";
}
// display # of comments if enabled
if (!empty($gal_dispNumComments)){
echo '<br /><i><a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'">'.$row['commenttotal']."</a> comment(s)</i><br />\n";
}
echo " </td>\n";
$gal_colcnt++;
}
mysql_free_result($gal_result);
echo " </tr>\n</table>\n";
if (!empty($gal_member) && empty($_GET['gal_viewall']))
echo '<br /><a href="'.$boardurl.'/index.php?action=profile;u='.$gal_member.';gal_viewall=1">View all pics from this member</a>';
if (!empty($gal_buddies) && empty($_GET['gal_viewall'])){
// build the link
$gal_querystring = $context['TPortal']['querystring'];
$gal_querystring .= empty($gal_querystring) ? 'gal_viewall=1' : ';gal_viewall=1';
echo '<br /><a href="'.$boardurl.'/index.php?'.$gal_querystring.'">View all pics of buddies</a>';
}
}
} else {
echo 'Sorry, you do not have permission to view pictures!';
}
Logged
Vincent Volmer
Community Suite Customer
Sr. Member
******
Offline Offline

Posts: 464


SMF 2.0.1


View Profile WWW
« Reply #9 on: October 14, 2008, 01:13:30 am »

I implemented this feature as a Tinyportal Block (I edited the code provided by Thurnok)

Hello,

I'm getting a error (I put did the code into a phpbox):

Code:
Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in /shared/usr/wcen4564565/DOMAIN/www.digiscrap.nl/HTML/Sources/Load.php(1839) : eval()'d code(35) : eval()'d code on line 75

Vincent
Logged

calumbo
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #10 on: October 18, 2008, 06:25:37 am »

I am running php5 and SMF 1.6 - Gallery 1.4 and tiny portal 0.98 (I think) - this is the code copied and pasted directly from my tinyportal block settings page. The error you gave was a php error regarding the scope of classes (I think)...

line 75 is this

$gal_disallowCats = "156";

you should change this to

$gal_disallowCats = "";

if you dont want to disallow any categories (I would guess you dont have a category 156 and so are getting an error)
Logged
Vincent Volmer
Community Suite Customer
Sr. Member
******
Offline Offline

Posts: 464


SMF 2.0.1


View Profile WWW
« Reply #11 on: October 18, 2008, 06:41:04 am »

Hello,

Yes, you are right... didn't notice that. Sorry....

It works and looks really nice! Is there a possibility to display also the 'new' comments (for your own images) in some way?
Could look like this;

3 (1 new) comment(s)


Thanks, regards

Vincent 

Logged

calumbo
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #12 on: October 18, 2008, 06:46:19 am »

I don't know - I'm real busy with other aspects of the forum I'm working on but I'll post the code for that here if I can get it working - It sounds like a nice feature (although the forum I'm working on does not have members galleries at the moment)... You could investigate yourself if you have a look at the structure of the database and work out the correct queries to send - even if you don't know mysql/php it's very easy to pick up.

Regards
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]

[May 17, 2012, 12:38:16 pm]

[May 15, 2012, 09:32:27 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.278 seconds with 19 queries.