News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Ad Management mod

Started by SMFHacks.com Team, January 30, 2006, 08:41:19 PM

Previous topic - Next topic

donelson

Ad Manager: ad_mod_v2-3-5_SMF_v2-0RC1-1

QuotePackage 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."

Steps 1-4 complete, but errors:

Quote1.   Execute Code   install.php   
   2.   Execute Modification   ./index.php   Test successful
   3.   Execute Modification   ./Sources/Admin.php   Test successful
   4.   Execute Modification   ./Themes/default/index.template.php   Test failed
   1.   Add After   ./Themes/default/index.template.php   Test successful
   2.   Replace   ./Themes/default/index.template.php   Test failed
   3.   Replace   ./Themes/default/index.template.php   Test failed
   4.   Add After   ./Themes/default/index.template.php   Test successful
   5.   Add After   ./Themes/default/index.template.php   Test successful
   6.   Add Before   ./Themes/default/index.template.php   Test successful
   5.   Execute Modification   ./Themes/default/BoardIndex.template.php   Test failed
   1.   Add Before   ./Themes/default/BoardIndex.template.php   Test successful
   2.   Add After   ./Themes/default/BoardIndex.template.php   Test failed
   6.   Execute Modification   ./Themes/default/Display.template.php   Test successful
   7.   Execute Modification   ./Themes/default/MessageIndex.template.php   Test failed
   1.   Add After   ./Themes/default/MessageIndex.template.php   Test successful
   2.   Add After   ./Themes/default/MessageIndex.template.php   Test failed
   8.   Execute Modification   ./Sources/ManagePermissions.php   Test successful
9.   Extract File   ./Sources/Ads.php   
10.   Extract File   ./Sources/LoadAds.php   
11.   Extract File   ./Themes/default/Ads.template.php   
12.   Extract File   ./Themes/default/languages/Ads.english.php   
13.   Extract File   ./Themes/default/languages/Ads.english-utf8.php


How should I proceed now? Thanks.
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

donelson

Can anyone help me please?

Thanks
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

I think I may have found a solution to this whole add problem for SMF version 2.0 RC2.
Someone please reply to this and tell me what you think?

10 Easy Steps to follow!!!

1.  SMF version 2.0 RC2.  In order to display google adds on your site, install the Portal Management Extension PortaMx for SMF 2 found by clicking either one of the two links below.
http://custom.simplemachines.org/mods/index.php?mod=1419
http://custom.simplemachines.org/mods/index.php?action=download;mod=1419;id=123536

2.  Then go to Admin - PortaMx Admin Centre - Block Manager - Panel Overview.

3.  Choose a panel on which you would like to display your adds, ex. Head, Top Centre, Left, Right, Bottom Centre, Foot, Frontpage, Single Page. (For this I have chosen Foot panel)

4.  On your selection on the right hand side click on "click to add foot block"

5.  Give your block a title ex. "Google Ads" (you can select to display this name or not, but you at least have to give it a title name.

6.  Make block type: "Script"

7.  Paste your script from the Google Adsense that you've created, be it only Text, Text or Image, or just Images.

8.  Further Down to the Right under "Type Name" - "Header" : you can select if you want the block title to be displayed or not.

9.  Go all the way down and press save.

10.  Now be patient Google ads will start appearing soon - usually it doesn't take more than 10 minutes before adds starts displaying on your site.

Tell me what you think if this has helped for you, I find it to display adds very nice on my site.

mseraphim

donelson

Why do these "installs" fail so much?

I did not even get past step #1...

Quote6.   Execute Modification   ./Sources/Display.php   Test failed
   1.   Replace   ./Sources/Display.php   Test failed

So what do I do now?


Quote from: mseraphim on November 21, 2009, 06:52:52 AM
I think I may have found a solution to this whole add problem for SMF version 2.0 RC2.
Someone please reply to this and tell me what you think?

10 Easy Steps to follow!!!

1.  SMF version 2.0 RC2.  In order to display google adds on your site, install the Portal Management Extension PortaMx for SMF 2 found by clicking either one of the two links below.
http://custom.simplemachines.org/mods/index.php?mod=1419
http://custom.simplemachines.org/mods/index.php?action=download;mod=1419;id=123536

2.  Then go to Admin - PortaMx Admin Centre - Block Manager - Panel Overview.

3.  Choose a panel on which you would like to display your adds, ex. Head, Top Centre, Left, Right, Bottom Centre, Foot, Frontpage, Single Page. (For this I have chosen Foot panel)

4.  On your selection on the right hand side click on "click to add foot block"

5.  Give your block a title ex. "Google Ads" (you can select to display this name or not, but you at least have to give it a title name.

6.  Make block type: "Script"

7.  Paste your script from the Google Adsense that you've created, be it only Text, Text or Image, or just Images.

8.  Further Down to the Right under "Type Name" - "Header" : you can select if you want the block title to be displayed or not.

9.  Go all the way down and press save.

10.  Now be patient Google ads will start appearing soon - usually it doesn't take more than 10 minutes before adds starts displaying on your site.

Tell me what you think if this has helped for you, I find it to display adds very nice on my site.

mseraphim
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Quote from: donelson on November 21, 2009, 07:50:45 AM
Why do these "installs" fail so much?

I did not even get past step #1...

Quote6.   Execute Modification   ./Sources/Display.php   Test failed
   1.   Replace   ./Sources/Display.php   Test failed

So what do I do now?



You need to make sure that all your files on your site server are writable - chmod 777 all files and directories, else you will keep on running into problems. Have a quick look at my site, just added google adds to it.  www.wirelesshotspot.co.za

donelson

Display.php -- shows all 777 -- read, write, execute...

:(

Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

donelson

I set all files in dir "Sources" to chmod 777

Now the forum does not come up at all, apache error 500

:( :(
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Quote from: donelson on November 21, 2009, 08:16:14 AM
I set all files in dir "Sources" to chmod 777

Now the forum does not come up at all, apache error 500

I hope you made a backup? You should do things like this on a testing server, not on your official site.

I can't help you much as I don't know anything about php or programming or even why your test failed.  I wouldn't know even where to begin looking.  I assume that you were working on a newly installed SMF?

donelson

Quote from: mseraphim on November 21, 2009, 08:22:30 AM
Quote from: donelson on November 21, 2009, 08:16:14 AM
I set all files in dir "Sources" to chmod 777

Now the forum does not come up at all, apache error 500

I hope you made a backup? You should do things like this on a testing server, not on your official site.

I can't help you much as I don't know anything about php or programming or even why your test failed.  I wouldn't know even where to begin looking.  I assume that you were working on a newly installed SMF?

Yes, not "online" to the public yet. Sigh.

I have issued a support-request to our hosting company.

W


Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Quote
Yes, not "online" to the public yet. Sigh.

I have issued a support-request to our hosting company.

W

I have reloaded my SMF several times before I got it right, and it was also with the help of some very nice people on SMF.

Something that you could try is maybe to re-upload your sources directory. This could potentially help with getting the site back up.  If it doesn't you may need to wipe everything and start over again.  Be sure that when your site is working to make a backup of the site through C-Panel.

One problem that I've found with my site is that some of my files didn't upload properly to my server.  You will see it when you compare the data size between files on your local disk and files on the server. Just compare the data size from your local disc to the files that failed that test on the server.

hope it helps?

mseraphim

donelson

Host company has got site back up, they say should use 755, not 777.

Display.php has permissions set to 755.

Still get "fail" error on install.

What now?

Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

donelson

Should I go ahead and install the whole thing, with the one error, then PATCH the file Display.php by hand?

thanks
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Quote from: donelson on November 21, 2009, 09:07:35 AM

Still get "fail" error on install.

What now?

if it has been a clean install, try to upload the display.php file again to your server and make sure the permissions are correct.

Just so I'm sure, you are trying to install PortaMx?

donelson

Quote from: mseraphim on November 21, 2009, 09:20:21 AMJust so I'm sure, you are trying to install PortaMx?

Thanks. Yes, PortaMx.

And my host company is investigating now, so I won't do anything else just yet.

W
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Quote from: mseraphim on November 21, 2009, 09:20:21 AM
Quote from: donelson on November 21, 2009, 09:07:35 AM

Still get "fail" error on install.

What now?

if it has been a clean install, try to upload the display.php file again to your server and make sure the permissions are correct.
Try to do the install again, and if it still fails contact the author of PortaMx under their support for the module section : http://www.simplemachines.org/community/index.php?topic=266721.0
Just so I'm sure, you are trying to install PortaMx?

mseraphim

This has got nothing to do with your hosting company. They only host your site, but what you do or put on is is up to you.

May I suggest that you contact the author on their support site : http://www.simplemachines.org/community/index.php?topic=266721.0

Feline (The Author) will definitely be able to help you.  Just state which files failed and hopefully you can get it sorted quickly.

donelson

Quote from: mseraphim on November 21, 2009, 09:26:50 AM
This has got nothing to do with your hosting company. They only host your site, but what you do or put on is is up to you.

May I suggest that you contact the author on their support site : http://www.simplemachines.org/community/index.php?topic=266721.0

Feline (The Author) will definitely be able to help you.  Just state which files failed and hopefully you can get it sorted quickly.

Thanks. My hosting company are excellent (ask me) and are familiar with SMF, and are attempting to fix this problem for me (and for their own knowledge as well).

Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

mseraphim

Cool, Not all hosting companies are like that.

Hope they could sort it out for you!!!!!

donelson

Okay, going naked here...

I have decided to try a manual fix of Display.php...

Replacing this original code:
Quote
   // This is just a regular attachment...
   else
   {
      // This checks only the current board for $board/$topic's permissions.
      isAllowedTo('view_attachments');

      // Make sure this attachment is on this board.
      // NOTE: We must verify that $topic is the attachment's topic, or else the permission check above is broken.
      $request = $smcFunc['db_query']('', '
         SELECT a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved
         FROM {db_prefix}attachments AS a
            INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg AND m.id_topic = {int:current_topic})
            INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board AND {query_see_board})
         WHERE a.id_attach = {int:attach}
         LIMIT 1',
         array(
            'attach' => $_REQUEST['attach'],
            'current_topic' => $topic,
         )
      );
   }

(Note: last line "'current_topic' => $topic,"  is NOT present in the source Display.php that came orignally with the package.

Replacing the above with:
Quote
   // This is just a regular attachment...
   else
   {
//-> start change PortaMx
      if(isset($_REQUEST['fld']))
      {
         // get group access
         $request = $smcFunc['db_query']('', '
               SELECT config
               FROM {db_prefix}portamx_blocks
               WHERE active = 1 AND blocktype = {string:blocktyp} AND id = {int:id}',
            array(
               'blocktyp' => 'download',
               'id' => (int) $_REQUEST['fld'],
            )
         );
         if($smcFunc['db_num_rows']($request) > 0)
         {
            $row = $smcFunc['db_fetch_assoc']($request);
            $smcFunc['db_free_result']($request);
            $cfg = unserialize($row['config']);
            $acsgrp = (isset($cfg['settings']['download_acs']) && is_array($cfg['settings']['download_acs']) ? $cfg['settings']['download_acs'] : array());
         }
         else
            $acsgrp = array();

         // check if enabled for the usergroup
         $show = AllowedTo('admin_forum');
         foreach($acsgrp as $g)
            $show = (is_numeric($g) && in_array((int) $g, $user_info['groups']) ? true: $show);

         if(!$show)
            redirectexit($scripturl .'?action=dlerror;sa=acs');

         // get the filedata from attach table
         $request = $smcFunc['db_query']('', '
               SELECT a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved
               FROM {db_prefix}attachments AS a
                   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
                   INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
               WHERE a.id_attach = {int:attach}
               LIMIT 1',
               array(
                   'attach' => $_REQUEST['attach'],
               )
         );
         if ($smcFunc['db_num_rows']($request) == 0)
            redirectexit($scripturl .'?action=dlerror;sa=fail');
      }
      else
      {
         // This checks only the current board for $board/$topic's permissions.
         isAllowedTo('view_attachments');

         // Make sure this attachment is on this board.
         // NOTE: We must verify that $topic is the attachment's topic, or else the permission check above is broken.
         $request = $smcFunc['db_query']('', '
            SELECT a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved
            FROM {db_prefix}attachments AS a
               INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg AND m.id_topic = {int:current_topic})
               INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board AND {query_see_board})
            WHERE a.id_attach = {int:attach}
            LIMIT 1',
            array(
               'attach' => $_REQUEST['attach'],
               'current_topic' => $topic,
            )
         );
      }
   }
//-> end change PortaMx

and will report if it works.

Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

donelson

I selected "Top Center" and put in PHP code, but I do not yet see any ads.



Quote from: mseraphim on November 21, 2009, 06:52:52 AM
I think I may have found a solution to this whole add problem for SMF version 2.0 RC2.
Someone please reply to this and tell me what you think?

10 Easy Steps to follow!!!

1.  SMF version 2.0 RC2.  In order to display google adds on your site, install the Portal Management Extension PortaMx for SMF 2 found by clicking either one of the two links below.
http://custom.simplemachines.org/mods/index.php?mod=1419
http://custom.simplemachines.org/mods/index.php?action=download;mod=1419;id=123536

2.  Then go to Admin - PortaMx Admin Centre - Block Manager - Panel Overview.

3.  Choose a panel on which you would like to display your adds, ex. Head, Top Centre, Left, Right, Bottom Centre, Foot, Frontpage, Single Page. (For this I have chosen Foot panel)

4.  On your selection on the right hand side click on "click to add foot block"

5.  Give your block a title ex. "Google Ads" (you can select to display this name or not, but you at least have to give it a title name.

6.  Make block type: "Script"

7.  Paste your script from the Google Adsense that you've created, be it only Text, Text or Image, or just Images.

8.  Further Down to the Right under "Type Name" - "Header" : you can select if you want the block title to be displayed or not.

9.  Go all the way down and press save.

10.  Now be patient Google ads will start appearing soon - usually it doesn't take more than 10 minutes before adds starts displaying on your site.

Tell me what you think if this has helped for you, I find it to display adds very nice on my site.

mseraphim
Mac dual G5, OSX 10.4.11 - SMF 2.0 RC2

Advertisement: