editing album properties or adding comments - parse errors in include/mailer.inc editing album properties or adding comments - parse errors in include/mailer.inc
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

editing album properties or adding comments - parse errors in include/mailer.inc

Started by kalyan, January 14, 2006, 09:20:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kalyan

I am having problems changing the album properties or adding comments
to photos in my standalone coppermine 1.4.3 installation, even as
admin.

In both cases (changing album properties or adding comments in the
comments window) I get the following error:

Parse error: parse error, unexpected T_ARRAY, expecting T_STRING in
/home/vhosts/kavitha.orgfree.com/cpm143/include/mailer.inc.php on line 2169

I have only very rudimentary knowledge of php to fix the error.
please help

Abbas Ali

include/mailer.inc.php is corrupted. Download a fresh copy of your cpg version and replace that file with new file.
Chief Geek at Ranium Systems

kalyan

> include/mailer.inc.php is corrupted. Download a fresh copy of your cpg
> version and replace that file with new file.

Where can I get a copy of the non-corrupted mailer.inc.php file?
I have used the one that came as part of the cpg 143 package.

Abbas Ali

It is possible that the file got corrupted in uploading. Reupload the same file. Also attach the same file in your next post so that we can take a look at it.
Chief Geek at Ranium Systems

kalyan

I downloaded the cpg143 again and uploaded the relevant mailer.inc.php
file. Results are same. I continue to get the parse errors around line 2169.

I am enclosing herewith parts of the mailer.inc.php file in the range where
the parsing error is cited, around the fline starting with
   function Send($from)

---
   /**
     * Gets help information on the keyword specified. If the keyword
     * is not specified then returns generic help, ussually contianing
     * A list of keywords that help is available on. This function
     * returns the results back to the user. It is up to the user to
     * handle the returned data. If an error occurs then false is
     * returned with $this->error set appropiately.
     *
     * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
     *
     * SMTP CODE SUCCESS: 211,214
     * SMTP CODE ERROR  : 500,501,502,504,421
     * @access public
     * @return string
     */
    function Help($keyword="") {
        $this->error = null; # to avoid confusion

        if(!$this->connected()) {
            $this->error = array(
                    "error" => "Called Help() without being connected");
            return false;
        }

        $extra = "";
        if(!empty($keyword)) {
            $extra = " " . $keyword;
        }

        fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);

        $rply = $this->get_lines();
        $code = substr($rply,0,3);

        if($this->do_debug >= 2) {
            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
        }

        if($code != 211 && $code != 214) {
            $this->error =
                array("error" => "HELP not accepted from server",
                      "smtp_code" => $code,
                      "smtp_msg" => substr($rply,4));
            if($this->do_debug >= 1) {
                echo "SMTP -> ERROR: " . $this->error["error"] .
                         ": " . $rply . $this->CRLF;
            }
            return false;
        }

        return $rply;
    }

    /**
     * Starts a mail transaction from the email address specified in
     * $from. Returns true if successful or false otherwise. If True
     * the mail transaction is started and then one or more Recipient
     * commands may be called followed by a Data command.
     *
     * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
     *
     * SMTP CODE SUCCESS: 250
     * SMTP CODE SUCCESS: 552,451,452
     * SMTP CODE SUCCESS: 500,501,421
     * @access public
     * @return bool
     */
    function array($from) {
        $this->error = null; # so no confusion is caused

        if(!$this->connected()) {
            $this->error = array(
                    "error" => "Called Mail() without being connected");
            return false;
        }

        fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF);

        $rply = $this->get_lines();
        $code = substr($rply,0,3);

        if($this->do_debug >= 2) {
            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
        }

        if($code != 250) {
            $this->error =
                array("error" => "MAIL not accepted from server",
                      "smtp_code" => $code,
                      "smtp_msg" => substr($rply,4));
            if($this->do_debug >= 1) {
                echo "SMTP -> ERROR: " . $this->error["error"] .
                         ": " . $rply . $this->CRLF;
            }
            return false;
        }
        return true;
    }
---

Abbas Ali

I am attaching a fresh copy of mailer.inc.php with this post. Download the file remove the .txt extenstion and upload it to your server. Check whether this works for you.

Also post the link to your site and non admin test  user account with ability to add comments.

P.S: I am sorry, i won't be able to help you through emails (kalyan sent me an email).
Chief Geek at Ranium Systems

kalyan

Well, I replaced the mailer.inc.php file with the one that you (Abbas Ali) has provided.
Error problems remain the same. I cannot edit album properties nor add comments
even as admin.  So I do not know if the error message is correct.

My cpg is at
  http://kavitha.orgfree.com/cpm143/index.php

I have created a visitor account (username: guest, password: guest)
with add comments enabled. I have also enabled debug info. display mode.

I tried to insert comments signing as this user. I get an empty db_input.php 
output page. Please have a look

Abbas Ali

Yes it gives blank page. Can't tell what's happening without debugging.

Just a wild guess - may be it has something to do with frames.
Chief Geek at Ranium Systems

kalyan

I am not sure if the frames are causing problems (I am using a web host with forced ads!)
I would appreciate receiving some guidelines on how to debug. Can I post a debug report
being displayed in my cpg?

I have a related question:
I have been told that sometimes "gzip" can cause problems. Do you know if CPG uses
gzip and how I can disable "gzip" if it is used?

When I installed CPG I had problems in uploading jpg image files (related to some
bug in PHP 4.4.1 release). I used the suggestions given in the cpg forum at
  http://forum.coppermine-gallery.net/index.php?topic=23342.0
to edit picmgmt.inc.php file. It worked nicely.



Joachim Müller

coppermine doesn't support output compression, if that's what you're asking.