Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 230
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 257
Total: 257

Author Topic: Added link "View topic"...ok!  (Read 8661 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
5428 Views
Last post May 04, 2007, 07:02:31 am
by SMFHacks
1 Replies
8933 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
8240 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210
2 Replies
3432 Views
Last post April 02, 2009, 12:49:25 pm
by dsmproject
3 Replies
4498 Views
Last post August 31, 2012, 11:30:29 am
by Jonas1975

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal