Welcome to Geeklog, Anonymous Thursday, December 26 2024 @ 06:12 pm EST

Geeklog Forums

PLease help


Status: offline

Sardog

Forum User
Newbie
Registered: 02/06/03
Posts: 11
Today I added the suggestion block to my GL. the followng code was added to my lib_custom.php
Text Formatted Code
function phpblock_suggest(){

   global $_TABLES, $_CONF, $_USER;

   $message="what would you like to see on the site?";
   $siteurl = $_CONF['site_url'];  

   if($_USER['username'] != ''){
               
                // we only need the email cos we know the username.  They have already passed validation and therefore
                // this cannot be spoofed.  So, only select email from the database.
                $result = DB_query("SELECT email FROM {$_TABLES['users']} WHERE username = '{$_USER['username']}'");
        $U = DB_fetchArray($result);
                $username = $_USER['username'];
                $useremail = $U[email];
                if($useremail == ''){
                        $useremail = 'anonymous@anonymous.com';
                        }
               
                }elseif($_USER['username'] == ''){
               
                $username = 'Guest';
                $useremail = 'anonymous@anonymous.com';
                }
               
        $display ="";
        $display .="<B>Hello $username, $message<B><BR>";
        $display .="";
        $display .="<BR>";
        $display .= "";
        $display .= "";
        $display .= "";
        $display .= "";
        $display .="";
        return $display;

}
Now when I bring my site up I have this error at the top: Warning: fopen("/home/sardog/logs/error.log", "a") - Permission denied in /home/sardog/public_html/lib-common.php on line 1555 I never made any changes to the lib_common.php. Also when I try to log out I get a flash of about 4 errors but its not long enough to see what they are. It refreshes back to my GL too quick. I can tell that 2 of the erors are in the lib_common.php and the other 2 are in users.php. How can I correct this?
 Quote

Status: offline

Sardog

Forum User
Newbie
Registered: 02/06/03
Posts: 11
I also added suggest.php to my /public_html which has the following code:
Text Formatted Code
<?php
   include('lib-common.php');
   global $_CONF;  
   $email="anonymous@anonymous.com";
   $adminemail = $_CONF['site_mail'];
   // Suggestion Box phpBlock created by Mr.GxBlock of http://www.gxblock.com Please don't remove this message.    
   echo COM_siteHeader();
   if($suggest != ''){
     if(strlen($suggest) < 10){
          echo COM_startBlock('Error');
          printf("Please go back and enter insert at unique message with at least 10 characters.");
          echo COM_endBlock();
          echo COM_siteFooter(true);
          exit();
          }
         if($suggest == '$textareamessage'){
          echo COM_startBlock('Error');
          printf("Please go back and enter insert at unique message with at least 10 characters.");
          echo COM_endBlock();
          echo COM_siteFooter(true);
          exit();
          }
          $suggest = str_replace(array(">", "<",""", "&"), array(">","<", """, "&"), $suggest);
          $suggest = stripslashes($suggest);
          $suggest = COM_checkWords($suggest);
      mail
      (
      "$adminemail",
      "From Your Suggestion Box - A New Request",
      "Name : $username from $REMOTE_ADDR
       Email : $useremail
       Note:
       $suggest
       ",
       "From: $useremailn"
      );
         echo COM_refresh($HTTP_REFERER);
         echo COM_startBlock('Your suggestion has been proccessed');
         printf("Thank you $username, you are now being transferring back to previous page. You may also <A HREF="$HTTP_REFERER">click here</A>.");
         echo COM_endBlock();
         echo COM_siteFooter(true);
         exit();
   }else{
         echo COM_startBlock('Error');
         printf("Please try again.");
         echo COM_endBlock();
         echo COM_siteFooter();
         exit();
   }
 ?>
Could any of this code be causing my problem?
 Quote

Mark

Anonymous
You have to change permission on the error and access logs to either 775 or 777. If you check your system error log, the other errors may be written there. If not, when you run this again they may show up in Geeklog\'s error log after changing permissions.
 Quote

Status: offline

Sardog

Forum User
Newbie
Registered: 02/06/03
Posts: 11
Thanks for the quick responce. So simple I overlooked it. You guys are great
 Quote

Status: offline

Shiva

Forum User
Newbie
Registered: 08/02/03
Posts: 1
Quote by Mark: You have to change permission on the error and access logs to either 775 or 777.
It works also with 666.
 Quote

Mark

Anonymous
666 does not work for those using shared hosting.
 Quote

Mark Bradbourne

Anonymous
unfocused
I'm running in to the same problem... I've set the permissions to 755, and it just returns the "Please try again." Error page... did I miss something? I copied the function to the custom_lib... I get nothing.

Any thoughts?
 Quote

Mark

Anonymous
Sorry, it's a slightly different problem.

It's just not working.

site_email is correct
permissions are correct

I'm at a loss.

http://www.neohmusic.com is the site.
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Looks like it works for registered users (didn't get the error). Did you get the test suggestions from me? If so you must have resctricted emailing in config.php. Check there.
Geeklog Polish Support Team
 Quote

All times are EST. The time is now 06:12 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content