Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4261
Latest: live627
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43353
Total Topics: 7534
Most Online Today: 146
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 128
Total: 128

Author Topic: Added link "View topic"...ok!  (Read 8807 times)

0 Members and 1 Guest are viewing this topic.

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Added link "View topic"...ok!
« on: November 17, 2008, 03:59:45 am »
Hi  :)
My friend has modified gallery.php and gallery.template.php ( little modify)
See attached image ( Clicca qui per vedere il topic relativo alla foto=View topic  )
Forum test: www.macroforum.org/prova/index.php
Seems it's ok!

Antonio

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Added link "View topic"...ok!
« Reply #1 on: November 19, 2008, 06:34:46 am »
Added too topic replies  number for the posted photos ( in  myImages too) !  :)
Antonio

Offline dimdom

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Added link "View topic"...ok!
« Reply #2 on: November 19, 2008, 07:07:35 am »
May you share the codes with us?

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Added link "View topic"...ok!
« Reply #3 on: November 19, 2008, 08:17:01 am »
May you share the codes with us?
Of course  :)
For the topic's link ( sources/gallery.php and theme/default/galley.template.php )

Gallery.php
Search for function ViewPicture():

Code: [Select]
function ViewPicture()
{
global $context, $mbname, $db_prefix, $modSettings, $user_info, $scripturl, $txt, $ID_MEMBER, $boardurl;

isAllowedTo('smfgallery_view');

// Get the picture ID
$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['gallery_error_no_pic_selected']);


// Show top Tabs
TopButtonTabs();


$dbresult = db_query("
SELECT
ID_PICTURE, USER_ID_CAT, ID_CAT , ID_TOPIC, ID_MEMBER
FROM {$db_prefix}gallery_pic
WHERE ID_PICTURE = $id  LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);


$USER_ID_CAT = $row['USER_ID_CAT'];
$ID_TOPIC =  $row['ID_TOPIC'];  // Edit by Roberto (associazione ID_TOPIC)


mysql_free_result($dbresult);

// other code.................................
...........................................

In gallery.template.php
Search for function template_view_picture() and near line 1380, before Show previous and next links, insert this code
Code: [Select]
{
echo '
<tr class="windowbg2">
<td align="center"><b>
<a href="http://www.yoursite/index.php/topic,' . $context['gallery_pic']['ID_TOPIC'] . '.0.html">Clicca qui per vedere il topic relativo alla foto</a>
</b>
</td>
</tr>';
}

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Added link "View topic"...ok!
« Reply #4 on: November 19, 2008, 08:26:45 am »
For the topic replies number in MyImasges page go to near  line 3107/3108 and replace
Code: [Select]
// Check if it is the user ids gallery mainly to show unapproved pictures or not
 if ($ID_MEMBER == $userid)
    $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal,
    p.filesize, p.thumbfilename, p.approved, p.views, p.ID_MEMBER, m.realName, p.date, p.mature, t.numReplies
       FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m, {$db_prefix}topics AS t
WHERE p.ID_MEMBER = $userid AND p.ID_MEMBER = m.ID_MEMBER  AND p.ID_TOPIC = t.ID_TOPIC
    ORDER BY p.ID_PICTURE DESC
    LIMIT $context[start]," . $modSettings['gallery_set_images_per_page'], __FILE__, __LINE__);
else
    $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.thumbfilename,
    p.approved, p.views, p.ID_MEMBER, m.realName, p.date,p.mature, t.numReplies
        FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m, {$db_prefix}topics AS t
         WHERE p.ID_MEMBER = $userid AND p.ID_MEMBER = m.ID_MEMBER AND p.approved = 1  AND p.ID_TOPIC = t.ID_TOPIC
         ORDER BY p.ID_PICTURE DESC
    LIMIT $context[start]," . $modSettings['gallery_set_images_per_page'], __FILE__, __LINE__);



while($row = mysql_fetch_assoc($dbresult))
{

if ($row['mature'] == 1 && $ID_MEMBER != $userid)
{
if (CanViewMature() == false)
$row['thumbfilename'] = 'mature.gif';
}

if($rowlevel == 0)
echo '<tr>';

echo '<td align="center"><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row['thumbfilename']  . '" /></a><br />';

if($ID_MEMBER == $userid)
{
if($row['approved'] == 1)
echo '<b>', $txt['gallery_myimages_app'], '</b><br />';
else
echo '<b>', $txt['gallery_myimages_notapp'], '</b><br />';
}
    echo $txt['smfgallery_commenti'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['numReplies'] . '</a>)<br />';

In modifications.english.php i have smf.gallery_commenti=replies


For the topic replies number in categories pages go to near  line 5407 and replace
Code: [Select]
// Show the pictures
$dbresult = db_query("
SELECT
p.ID_PICTURE, p.totalratings, t.ID_TOPIC, t.numReplies, p.rating, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.realName, p.date, p.description, p.mature
FROM {$db_prefix}gallery_pic as p
LEFT JOIN {$db_prefix}members AS m ON (p.ID_MEMBER = m.ID_MEMBER)
        LEFT JOIN {$db_prefix}topics AS t ON (p.ID_TOPIC = t.ID_TOPIC)
WHERE  p.ID_CAT = $cat AND p.approved = 1 ORDER BY $sortby $orderby
LIMIT $context[start]," . $modSettings['gallery_set_images_per_page'], __FILE__, __LINE__);
$rowlevel = 0;

if (!isset($context['gallery_cat_norate']))
$context['gallery_cat_norate'] = 0;

while($row = mysql_fetch_assoc($dbresult))
{
if ($row['mature'] == 1)
{
if (CanViewMature() == false)
$row['thumbfilename'] = 'mature.gif';
}


if ($rowlevel == 0)
echo '<tr>';

echo '<td align="center">';
if (!empty($modSettings['gallery_set_t_title']))
echo $row['title'] . '<br />';

echo '<a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="', $modSettings['gallery_url'], $row['thumbfilename'], '" /></a><br />';

echo '<span class="smalltext">';
if (!empty($modSettings['gallery_set_t_rating']) && $context['gallery_cat_norate'] != 1)
{
if ($gallerySettings['gallery_points_instead_stars'])
echo $txt['gallery_form_rating'] . $row['rating'] . '<br />';
else
echo $txt['gallery_form_rating'] . GetStarsByPrecent(($row['totalratings'] != 0) ? ($row['rating'] / ($row['totalratings']* 5) * 100) : 0) . '<br />';

}

if (!empty($modSettings['gallery_set_t_views']))
echo $txt['gallery_text_views'] . $row['views'] . '<br />';
if (!empty($modSettings['gallery_set_t_filesize']))
echo $txt['gallery_text_filesize'] . round($row['filesize'] / 1024, 2) . 'KB<br />';
if (!empty($modSettings['gallery_set_t_date']))
echo $txt['gallery_text_date'] . timeformat($row['date']) . '<br />';
if (!empty($modSettings['gallery_set_t_comment']))
echo $txt['smfgallery_commenti'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['numReplies'] . '</a>)<br />';
if (!empty($modSettings['gallery_set_t_username']))
{
if ($row['realName'] != '')
echo $txt['gallery_text_by'] . ' <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['realName'] . '</a><br />';
else
echo $txt['gallery_text_by'] . ' ' . $txt['gallery_guest'] . '<br />';
}


Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Added link "View topic"...ok!
« Reply #5 on: November 19, 2008, 08:28:19 am »
Logically i use only poste images, i disabled personal album and comments  :)

Offline dimdom

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Added link "View topic"...ok!
« Reply #6 on: November 20, 2008, 02:22:32 am »
Thank you!

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Added link "View topic"...ok!
« Reply #7 on: November 20, 2008, 03:00:31 am »

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
5551 Views
Last post May 04, 2007, 07:02:31 am
by SMFHacks
1 Replies
9094 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
8415 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210
2 Replies
3461 Views
Last post April 02, 2009, 12:49:25 pm
by dsmproject
3 Replies
4548 Views
Last post August 31, 2012, 11:30:29 am
by Jonas1975

+- Recent Topics

Recent Items On Main Index by SMFHacks
July 22, 2024, 07:53:34 pm

SMF Gallery Pro 10.0 - Released! by SMFHacks
July 21, 2024, 11:18:35 am

Opportunity to use more hooks by SMFHacks
July 21, 2024, 11:08:45 am

Installation error: code not found by SMFHacks
July 20, 2024, 10:30:33 am

Installation warning: file not found by SMFHacks
July 20, 2024, 10:30:19 am

Setting a photo as invisible by SMFHacks
July 16, 2024, 11:05:06 pm

2.1.4 - Using drag and drop. by SMFHacks
July 16, 2024, 10:35:13 pm

Rate own images by SMFHacks
July 16, 2024, 10:25:55 pm

Site upgrade to 2.1 by SMFHacks
July 12, 2024, 07:47:03 am

Issues with Pretty URLs 4.1 by Randem
June 27, 2024, 07:32:22 pm

Powered by EzPortal