SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 25, 2012, 01:03:55 am

Login with username, password and session length
Members
Total Members: 10071
Latest: cdavidson012
Stats
Total Posts: 28687
Total Topics: 4977
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 40
Total: 40
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Facebook like button  (Read 1862 times)
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« on: May 30, 2011, 11:29:02 am »

is it possible to put a like button every photos uploaded in the gallery?

thanks

reyver
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #1 on: May 30, 2011, 11:49:05 am »

Yes on the view picture page you would need to modify the gallery.template.php file then in there find the view_picture function
Logged
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #2 on: May 30, 2011, 12:17:56 pm »

i will put the code from the facebook plugin in gallery.template.php ?
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #3 on: May 30, 2011, 12:18:37 pm »

Yes in the template_view_picture function
Logged
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #4 on: May 30, 2011, 06:49:47 pm »

Good day again,

i cant find the view_picture function is it inside the gallery.template.php? cause when i open the it i didnt find the view_picture

thanks

reyver
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #5 on: May 30, 2011, 07:38:49 pm »

Should be i think function template_view_picture
Logged
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #6 on: May 30, 2011, 07:44:20 pm »

i found this  "gallery_theme.php" in /public_html/gallery/modules/gallery/helpers

and when i open the file i cant find template_view_picture

thanks

reyver
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #7 on: May 30, 2011, 07:53:14 pm »

If you are using SMF Gallery Lite
The file is themes/default/gallery.template.php
Logged
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #8 on: May 30, 2011, 08:36:13 pm »

ok im on the file, is the code from facebook plugin needs to be insert or need to replace some code in the template_view_picture?

thanks

reyver
Logged
reyver
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #9 on: May 30, 2011, 11:40:50 pm »

Hope you dont mind asking this.

This is the Template_view_ Picture code

Quote

function template_view_picture()
{
   global $scripturl, $context, $txt,  $id_member, $modSettings, $memberContext;

   // Load permissions
   $g_manage = allowedTo('smfgallery_manage');
   $g_edit_own = allowedTo('smfgallery_edit');
   $g_delete_own = allowedTo('smfgallery_delete');

   // Keywords
   $keywords = explode(' ',$context['gallery_pic']['keywords']);
    $keywordscount = count($keywords);


   ShowTopGalleryBar();
   


   echo '<br /><table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
         <tr class="catbg">
            <td align="center">' . $context['gallery_pic']['title'] . '</td>
         </tr>
         <tr class="windowbg2">
            <td align="center"><img height="' . $context['gallery_pic']['height']  . '" width="' . $context['gallery_pic']['width']  . '" src="' . $modSettings['gallery_url'] . $context['gallery_pic']['filename']  . '" alt="" /></td>
         </tr>
         <tr class="windowbg2">

            <td>
            <b>' . $txt['gallery_form_description'] . ' </b>' . (parse_bbc($context['gallery_pic']['description'])  ). '
            <hr />
            ' . $txt['gallery_text_picstats'] . '<br />

            ' . $txt['gallery_text_views'] . $context['gallery_pic']['views'] . '<br />
            ' . $txt['gallery_text_filesize']  . gallery_format_size($context['gallery_pic']['filesize'],2) . '<br />
            '  . $txt['gallery_text_height'] . ' ' . $context['gallery_pic']['height']  . '  ' . $txt['gallery_text_width'] . ' ' . $context['gallery_pic']['width'] . '<br />
            ';
   
            if (!empty($context['gallery_pic']['keywords']))
            {
            
               echo $txt['gallery_form_keywords'] . ' ';
               for($i = 0; $i < $keywordscount;$i++)
               {
                  echo '<a href="' . $scripturl . '?action=gallery;sa=search2;key=' . $keywords[$i] . '">' . $keywords[$i] . '</a>&nbsp;';
               }
               echo '<br />';
               
            }


            

            if ($context['gallery_pic']['real_name'] != '')
               echo$txt['gallery_text_postedby'] . '<a href="' . $scripturl . '?action=profile;u=' . $context['gallery_pic']['id_member'] . '">'  . $context['gallery_pic']['real_name'] . '</a>' . $txt['gallery_at'] . $context['gallery_pic']['date'] . '<br /><br />';
            else
               echo $txt['gallery_text_postedby'] . $txt['gallery_guest']  . $txt['gallery_at'] . $context['gallery_pic']['date'] . '<br /><br />';
            
            
            
            // Show image linking codes
            if ($modSettings['gallery_set_showcode_bbc_image']  || $modSettings['gallery_set_showcode_directlink'] || $modSettings['gallery_set_showcode_htmllink'])
            {
               echo '<b>',$txt['gallery_txt_image_linking'],'</b><br />
               <table border="0">
               ';
               
               if ($modSettings['gallery_set_showcode_bbc_image'])
               {
                  echo '<tr><td width="30%">', $txt['gallery_txt_bbcimage'], '</td><td> <input type="text" value="" size="50" /></td></tr>';
               }
               if ($modSettings['gallery_set_showcode_directlink'])
               {
                  echo '<tr><td width="30%">', $txt['gallery_txt_directlink'], '</td><td> <input type="text" value="' . $modSettings['gallery_url'] . $context['gallery_pic']['filename']  . '" size="50" /></td></tr>';
               }
               if ($modSettings['gallery_set_showcode_htmllink'])
               {
                  echo '<tr><td width="30%">', $txt['gallery_set_showcode_htmllink'], '</td><td> <input type="text" value="<img src=&#34;' . $modSettings['gallery_url'] . $context['gallery_pic']['filename']  . '&#34; />" size="50" /></td></tr>';
               }
               
               echo '</table>';
               
            }      

            // Show edit picture links if allowed
            if ($g_manage)
               echo '&nbsp;<a href="' . $scripturl . '?action=gallery;sa=unapprove;pic=' . $context['gallery_pic']['id_picture'] . '">' . $txt['gallery_text_unapprove'] . '</a>';
            if ($g_manage || $g_edit_own && $context['gallery_pic']['id_member'] == $id_member)
               echo '&nbsp;<a href="' . $scripturl . '?action=gallery;sa=edit;pic=' . $context['gallery_pic']['id_picture']. '">' . $txt['gallery_text_edit'] . '</a>';
            if ($g_manage || $g_delete_own && $context['gallery_pic']['id_member'] == $id_member)
               echo '&nbsp;<a href="' . $scripturl . '?action=gallery;sa=delete;pic=' . $context['gallery_pic']['id_picture'] . '">' . $txt['gallery_text_delete'] . '</a>';


            // Show report picture link
            if (allowedTo('smfgallery_report'))
               echo '&nbsp;<a href="' . $scripturl . '?action=gallery;sa=report;id=' . $context['gallery_pic']['id_picture'] . '">' . $txt['gallery_text_reportpicture'] . '</a>';
      

            echo '
            </td>
         </tr>';

      // Display who is viewing the picture.
      if (!empty($modSettings['gallery_who_viewing']))
      {
         echo '<tr>
         <td align="center" class="windowbg2"><span class="smalltext">';

         // Show just numbers...?
         // show the actual people viewing the topic?
         echo empty($context['view_members_list']) ? '0 ' . $txt['gallery_who_members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['gallery_who_hidden'] . ')');

         // Now show how many guests are here too.
         echo $txt['who_and'], @$context['view_num_guests'], ' ', @$context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['gallery_who_viewpicture'], '</span></td></tr>';
      }

echo '
      </table><br />';
   //Check if allowed to display comments for this picture
   if ($context['gallery_pic']['allowcomments'])
   {
      //Show comments
      echo '<table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
            <tr class="catbg">
               <td align="center" colspan="2">' . $txt['gallery_text_comments'] . '</td>
            </tr>';

      if (allowedTo('smfgallery_comment'))
      {
         //Show Add Comment
         echo '
            <tr class="titlebg"><td colspan="2">
            <a href="' . $scripturl . '?action=gallery;sa=comment;id=' . $context['gallery_pic']['id_picture'] . '">' . $txt['gallery_text_addcomment']  . '</a></td>
            </tr>';
      }

      // Display all user comments
   
      $comment_count = $context['gallery_comment_count'];

      foreach($context['gallery_comment_list'] as $row)
      {
         echo '<tr class="windowbg">';
         // Display member info
         echo '<td width="10%" valign="top">
         <a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">'  . $row['real_name'] . '</a><br />
         <span class="smalltext">' . $txt['gallery_text_posts'] . $row['posts'] . '</span><br />';
         // Display the users avatar
            $memCommID = $row['id_member'];
            loadMemberData($memCommID);
         loadMemberContext($memCommID);

         
         echo $memberContext[$memCommID]['avatar']['image'];
         
         echo '
         </td>';
         // Display the comment
         echo '<td width="90%"><span class="smalltext">' . timeformat($row['date']) . '</span><hr />';

         echo   parse_bbc($row['comment']);

         // Check if the user is allowed to delete the comment.
         if($g_manage)
            echo '<br /><a href="' . $scripturl . '?action=gallery;sa=delcomment;id=' . $row['id_comment'] . '">' . $txt['gallery_text_delcomment'] .'</a>';


         echo '</td>';
         echo '</tr>';
      }



      // Show Add Comment link again if there are more than one comment
      if( allowedTo('smfgallery_comment') && $comment_count != 0)
      {
       // Show Add Comment
         echo '
            <tr class="titlebg">
               <td colspan="2">
               <a href="' . $scripturl . '?action=gallery;sa=comment;id=' . $context['gallery_pic']['id_picture'] . '">' . $txt['gallery_text_addcomment'] . '</a>
               </td>
            </tr>';
      }

      echo '</table><br />';
   }
   

   // Link back to the gallery index
   echo '<div align="center"><a href="', $scripturl, '?action=gallery">' . $txt['gallery_text_returngallery'] . '</a></div><br />';



   GalleryCopyright();
}

and this the code from facebook plugins

Quote

can you teach me how to do it?

thanks in advance,

Regards,

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

Recent
[May 24, 2012, 08:02:50 am]

[May 24, 2012, 04:11:41 am]

[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]
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 4.776 seconds with 21 queries.