Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 166
Total: 166

Author Topic: Facebook like button  (Read 10961 times)

0 Members and 1 Guest are viewing this topic.

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Facebook like button
« on: May 30, 2011, 11:29:02 am »
is it possible to put a like button every photos uploaded in the gallery?

thanks

reyver

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Facebook like button
« 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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Facebook like button
« Reply #2 on: May 30, 2011, 12:17:56 pm »
i will put the code from the facebook plugin in gallery.template.php ?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Facebook like button
« Reply #3 on: May 30, 2011, 12:18:37 pm »
Yes in the template_view_picture function
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Facebook like button
« 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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Facebook like button
« Reply #5 on: May 30, 2011, 07:38:49 pm »
Should be i think function template_view_picture
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Facebook like button
« 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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Facebook like button
« 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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Facebook like button
« 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

Offline reyver

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Facebook like button
« 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
<iframe src="http://www.facebook.com/plugins/like.php?app_id=170685896314252&amp;href=http%3A%2F%2Fedwinloyola.com%2Findex.php%3Faction%3Dgallery&amp;send=false&amp;layout=standard&amp;width=400&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:35px;" allowTransparency="true"></iframe>

can you teach me how to do it?

thanks in advance,

Regards,

Rey

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3445 Views
Last post February 03, 2009, 10:22:20 am
by Lon
6 Replies
6026 Views
Last post April 18, 2010, 05:06:07 pm
by SMFHacks
9 Replies
7212 Views
Last post September 23, 2011, 01:49:39 pm
by profsl
12 Replies
17536 Views
Last post September 28, 2015, 02:13:15 pm
by SMFHacks
22 Replies
13218 Views
Last post February 05, 2014, 08:53:06 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal