Package Manager: Facebook "Like" Button

Started by Moderator11, December 13, 2011, 03:26:34 AM

Previous topic - Next topic

Moderator11

Since I was not able to upload the .zip file for the Facebook like button made by moderator Ricky, a friend of mine manually placed the files in a folder in the package manager via ssh.  The files are there in my packages menu, but not installed.  when I go to the miscellaneous section under modifications to specify my ID numbers and such for the Facebook button package, nothing shows up.  Any idea what is wrong?

Ricky.

You should have asked in Support thread of that MOD.
Anyways, here since you were not able to upload due to some reason (may be your server issue) , now you says that your friend uploaded using ssh , what I guess is now permission issue.

Rather upload package using FTP in Packages folder.

Moderator11

The uploading problem was that I would compress the files into .zip, but after I uploaded them the package manager reported that they were empty.  I'm using Mac OS X. 
Which packages folder do you mean?  I went under file permissions and saw the packages folder, but all I can do there is tell it to be customizable.  Also, does it matter that we used my FTP username and password in ssh to add the folder that we put the files in?

Ricky.

Why you need to compress it, it already comes compressed, you are only supposed to upload it.
Also, why use SSH, use FTP, filezilla is good one , works on Mac too.

If nothing works, then uncompress the folder and upload it in your forums Packages folder using FTP, then it should be available in Admin --> Packages

Moderator11

That last bit of advice is what we did- there's a folder that we made in the Packages section where we put the files, and when I browse my packages the files are there but not installed.  I think the problem is that I just have to execute them somehow.  Do you know how to do that?

Ricky.

If you upload files there then it should show option to install it. Admin --> Packages

Moderator11

Using FTP I placed the files inside my packages folder.  When I go to browse packages under admin, the package is listed but my only options are to delete or list the files.  There is no install option.  The packages folder is set to chmod 0777, so that isn't the solution either.

Ricky.

What is your SMF version ?
It will work on SMF 2.0 and 2.0.1 only.


DarkT3rror

try to find out in Modifications about this mod, Also including 2.0.1 Version.. The only you have to do is to upload it with your zip/rar file and then press download, so the files where are into compressed file will be extracted into server and the only you have to do is to go to the options menu in administrator panel layouts and find out the option of Facebook Like button settings and tick it... so will be active.

Joker™

Quote from: DarkT3rror on December 16, 2011, 11:22:20 AM
try to find out in Modifications about this mod, Also including 2.0.1 Version.. The only you have to do is to upload it with your zip/rar file and then press download, so the files where are into compressed file will be extracted into server and the only you have to do is to go to the options menu in administrator panel layouts and find out the option of Facebook Like button settings and tick it... so will be active.

DarkT3rror, I think the user tried that only in the first place which hasn't worked out for him.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Moderator11

Thanks for the advice, but yes Joker is right- the answer must be so simple because the files are there under packages, just not activated.  I cannot find the method for activating (downloading) them so that the modification will actually become part of the forum. 

Joker™

Moderator11, I'm in a but of hurry. Just wanted to ask some pretty simple questions (you might have already did this, but just wanted to get sure of everything)

- What happens when you upload the mod using package manager?

About manually upload the mod have you followed these steps
- Download the mod from the mod site
- Upload the mod in "Packages" directory using FTP as Ricky has suggested
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Moderator11

When using the package manager I get this message upon uploading the .zip file-

Package upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

After following these instructions, yes, the manager does recognize the files, but they are not actually installed.
There are other users who have had similar problems, and they have largely been told to make sure the chmod is set to 0777.  I tried that and it had no effect.

Yes I have followed the directions, and the result above was the result.  A former moderator told me that my Mac may be extracting the files before I upload them, but I don't know how to fix that problem. 

Illori

do you have a temp folder and can the server write to the folder?

Moderator11

Yes, within my packages folder I created a subfolder which contains the files for the modification.  These files are marked "web visible" and "executable."  Other than that I don't know how to tell if the server can write to the folder.
When I look at the file permissions under the package manager, the package file is also marked as "writable."

DarkT3rror

when you add it shows you an error or something else including an instalation issue??? if not something is going wrong with the modificitation...

Illori

Quote from: DarkT3rror on December 16, 2011, 03:54:22 PM
when you add it shows you an error or something else including an instalation issue??? if not something is going wrong with the modificitation...

not most likely it is not an issue with the mod, it is an issue with the permissions.

DarkT3rror

Quote from: Illori on December 16, 2011, 04:29:34 PM
Quote from: DarkT3rror on December 16, 2011, 03:54:22 PM
when you add it shows you an error or something else including an instalation issue??? if not something is going wrong with the modificitation...

not most likely it is not an issue with the mod, it is an issue with the permissions.

i think that all of the registered users got the access to press like button except guests.... So... why the problem is about the permissions???

Illori

permissions with the files/folders not permissions with the mod. if you read the thread the user is having issues just getting the mod to install not to be able to use it.

Moderator11

So if I can't alter the permissions through package manager, and my FTP says that the files are executable, where else would I be able to alter the permission settings so that the forum will allow me to install the files in my packages folder?

Illori

executable is not the same as writable, you need to check for writable

Moderator11

Alright- I checked the packages folder in my FTP manager and it was only web visible, so I tried to set it to executable as well.  The files inside are web visible and executable.  I also set the permissions so that I could write the packages folder.  In the packages manager, the packages folder is set as writable, and I set the chmod to 0777 to see if that made a difference.  When nothing happened, I then set the permissions to custom, and selected standard permissions.  After doing so the page said it could not connect to the FTP server and it eventually reloaded without the change in permissions made.

Ricky.

If nothing works then you may install mod manually , just download files using FTP and then modify as per mod and re-upload. Just make sure you make backups of files your going to modifying.

Use package parser or see instructions here -> Manual Mod installation

Moderator11

I will give the manual installation a shot thank you- the thing is that not all packages are giving me problems.  The packages that have a download button next to them on the download packages page install very quickly and work very well.  The ones that give me issues are the packages that don't allow me to download them right there- the ones that I have to upload first.  Do you think adding a server to my package manager from SMF.org would allow me to download straight from the modifications page and bypass all of these problems?

Illori

the smf package server should be there automatically, but for some reason it does not always show all packages. it does sound like this is an issue with permissions as when you let the server download the package it can set the permissions correctly where there are some cases where when you upload the package the permissions may need to be configured depending on your server configuration.

Moderator11

Yes I think you're right- when I try to access the SMF server it always tells me that it cannot connect to it.  Is there a certain URL that I need to enter so that it will work?

Illori

no as there is only one and it is the one that is already in the package manager

Moderator11

Alright I'm working on the manual implementation, but I quickly ran into a snag- where is the ./Sources/ManageSettings.php file?  I can't find a file named sources or manage settings anywhere

Illori


Moderator11

I went to modify themes, and I looked throughout both the core and default themes and could not find the sources folder.  Do you know if it is inside of something else?  An exact location perhaps?

Illori

you should be using ftp if you are going to try to install a mod manually. the sources folder is not in the themes folder so you would not find it there. dont forget to do a backup before you try to do the manual install in case you mess up you can restore the backup and try again.

Moderator11

That would explain it!  Yes I went to the maintenance section and downloaded a backup.  Thank you very much for the help

Illori

that is only a backup of the database not your files, and that database backup may not be complete, please use cpanel/phpmyadmin or similar to get a backup of your database and use ftp to backup your files.

Moderator11


Moderator11

Ok I installed all instructed pieces of code by Ricky- now I am on the Facebook code portion.  I cannot get the first bit of code to work right with the body code portion of the template under index.template.php

Here's the code (I was told to place it after <body>):

<body>';
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
}
function template_body_above()
{

Here's the error: Parse error: syntax error, unexpected '<' in index.template.php on line 203
Would you mind checking it out to see what I did wrong?

Ricky.

You should use full code, some part is missing in your code, it should be :

Find:

// the upshrink image, right-floated


Just before that add following....

if(!empty($modSettings['e_fb_enable']) && $context['current_action'] != 'admin'){
// Advance FB like with OG
echo '<span style="float: right; margin-top: 10px;"><div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: \'',(empty($modSettings['e_fb_appId'])?'your app id':$modSettings['e_fb_appId']),'\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol +
      \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
</script>
<fb:like send="false" layout="button_count" width="100" show_faces="false" font=""></fb:like></span>';
} // Advance FB like with OG



Moderator11

I used this bit of code already- everything that was in the parse manual I have put into the code for the forum, but now I have to get the ID so that it will show up on my site and work.  Do I simply have to take the ID out of the code that Facebook supplies and put it into what I already added to the forum code? 

Illori

you would be best to ask that question in the mods support thread.

Moderator11


Advertisement: