Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4229
Latest: Ghost
New This Month: 3
New This Week: 0
New Today: 0
Stats
Total Posts: 43074
Total Topics: 7493
Most Online Today: 108
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 33
Total: 33

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

+- Recent Topics

Version 6.1.6 issues by davejo
Today at 02:21:44 pm

Follow / Follower Mod? by SMFHacks
September 23, 2023, 08:44:44 am

Looking for a good video player by replayuk
September 23, 2023, 12:17:39 am

[Mod]Discord Web Hooks by SMFHacks
September 22, 2023, 03:57:28 pm

SMF 2.1.4 Search by Anmer
September 22, 2023, 01:55:15 pm

Error in thise mode by Ghost
September 15, 2023, 08:42:24 am

Gallery Selection List Order by mickjav
September 07, 2023, 12:46:31 pm

[Mod]Tidy Child Boards 2.0 by Norwinjose
September 02, 2023, 11:42:54 am

PrettyUrls SEO Pro: Unable to submit sitemap to google search conmsole by SMFHacks
August 31, 2023, 10:55:22 am

PrettyURL - SEO4SMF Rewrites? by SMFHacks
August 28, 2023, 06:35:33 pm

Powered by EzPortal