forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 PHPnuke/Postnuke Support => Topic started by: eolica on November 30, 2003, 01:00:01 pm

Title: BUGS using with postnuke
Post by: eolica on November 30, 2003, 01:00:01 pm
When using RC4 under postnuke I get the following "error" on top of each and every coppermine screen:

Warning: Cannot add header information - headers already sent by (output started at c:\phpdev5\www\public\726\header.php:117) in c:\phpdev5\www\public\726\modules\Coppermine\include\functions.inc.php on line 56
Title: BUGS using with postnuke
Post by: eolica on November 30, 2003, 01:13:00 pm
and also:

Warning: Cannot add header information - headers already sent by (output started at c:\phpdev5\www\public\726\header.php:117) in c:\phpdev5\www\public\726\modules\Coppermine\db_input.php on line 304

after adding new picture
Title: BUGS using with postnuke
Post by: DJMaze on November 30, 2003, 05:51:02 pm
did you upload all files ?

because
Code: [Select]
Warning: Cannot add header information - headers already sent by (output started at c:\phpdev5\www\public\726\header.php:117) in c:\phpdev5\www\public\726\modules\Coppermine\include\functions.inc.php on line 56 are solved.

load.inc.php should say this at the end:
Code: [Select]
   require($CPG_M_DIR . '/include/init.inc.php');
    if (defined('IN_POSTNUKE') && !defined('NO_HEADER')) require("header.php");
Title: BUGS using with postnuke
Post by: eolica on December 01, 2003, 01:02:08 am
Quote from: "DJMaze"
did you upload all files ?

load.inc.php should say this at the end:
Code: [Select]
   require($CPG_M_DIR . '/include/init.inc.php');
    if (defined('IN_POSTNUKE') && !defined('NO_HEADER')) require("header.php");


Yes, it is this way.
For your info: the warning doesn't appear with postnuke .726 when user is not logged in; it appears with pn .714 in any case  :?:
Yes, I cleared all the cookies :!:
Title: BUGS using with postnuke
Post by: DJMaze on December 01, 2003, 01:18:39 am
ehm you didn't told me that.

I developed using postnuke .726

Why still use the Rogue_714 of postnuke ?
Title: BUGS using with postnuke
Post by: eolica on December 01, 2003, 01:48:38 am
A couple of answers:

1) when in pn.726 the problem still occurs when user is logged in;

2) (almost OT) some months ago the postnuke team was broken and from the original developers a new team and a new project came out: xaraya.
The last release appairing to be portable to xaraya was .714 (some of the versions that came out after that where more or less buggy).
So I decided to keep all my live sites at .714, waiting for the official xaraya release to move to that new system (like me, several other people did the same).
Now, .726 seems to have corrected bugs and improved api compliance, and I've installed it in my local testbox.
Next release (pn . 8 ) is going to adopt smarty as template engine, and a lot of differences will become evident.

I must admit that I'm a little bit confused: xaraya is a very powerful system, but also quite steep in learning - you can do beautiful things, but everything has a price. So I have some doubts.
And Coppermine doesn't work in xaraya  :!:
Title: BUGS using with postnuke
Post by: DJMaze on December 01, 2003, 03:52:41 am
Ok then:

- where can i download latest release of xaraya ?
- Shall install 714 local
- You can give me urls where the errors occure ?
  (ex.: modules.php?op=modload&name=coppermine&file=usrmgr)
Title: BUGS using with postnuke
Post by: eolica on December 01, 2003, 09:11:43 am
Quote from: "DJMaze"

- where can i download latest release of xaraya ?

On sourceforge: http://sourceforge.net/projects/xaraya/

Quote from: "DJMaze"

- You can give me urls where the errors occure ?
  (ex.: modules.php?op=modload&name=coppermine&file=usrmgr)

Easier to say where it doesn't :(  :
- modules.php?op=modload&name=Coppermine&file=editpics&mode=upload_approval
- modules.php?op=modload&name=Coppermine&file=reviewcom
- modules.php?op=modload&name=Coppermine&file=help
Title: Other bugs
Post by: eolica on December 02, 2003, 07:20:33 pm
Since I'm probably the only one testing under postnuke, I'll continue posting bugs in this thread.

Well, when calling to show a category:

In phpnuke is:
modules.php?name=Coppermine&cat=4 :lol:

In postnuke has been changed to:
modules.php?op=modload&name=Coppermine&cat=4 :cry:

while it should be:
modules.php?op=modload&name=Coppermine&file=index&cat=4 :idea:

I don't know where should be changed    :?:
Title: BUGS using with postnuke
Post by: DJMaze on December 02, 2003, 07:59:16 pm
some $CPG_URL need to be changed to $CPG_M_URL
Title: BUGS using with postnuke
Post by: eolica on December 02, 2003, 08:58:42 pm
Not bad as a starting point:
a short search for $CPG_URL gives a list of 36 files :cry: :
- 5 files under /include
- 12 files under /themes/default
- 19 files under /

while $CPG_M_URL is only in 4 files
Title: BUGS using with postnuke
Post by: DJMaze on December 02, 2003, 09:48:31 pm
fixed :D

replace all $CPG_URL in index.php to $CPG_M_URL
Title: BUGS using with postnuke
Post by: eolica on December 03, 2003, 12:14:40 am
Replacing in index.php solved the basic link for categories;
the problem is still present when clicking on the breadcrumb.

To solve I changed the breadcrumb function in /include/functions.inc.php:
Code: [Select]

function breadcrumb($cat, &$breadcrumb, &$BREADCRUMB_TEXT)
{
    global $album, $lang_errors, $lang_list_categories, $lang_meta_album_names;
    global $CONFIG, $CURRENT_ALBUM_DATA, $CURRENT_CAT_NAME, $CPG_URL, $CPG_M_URL;
    if (($cat == 0) && $album != '') {
        if (is_numeric($album)) {
            $result = db_query("SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $album . "'");
            if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_cat'], __FILE__, __LINE__);
            $row = mysql_fetch_array($result);
            $breadcrumb = '<a class="statlink" href="' . $CPG_M_URL . '">' . _HOME . '</a> > ' . $row["title"] . ' ';
        } else {
            $breadcrumb = '<a class="statlink" href="' . $CPG_M_URL . '">' . _HOME . '</a>' . $breadcrumb . ' > ' . $BREADCRUMB_TEXT . ' ';
        }
        $BREADCRUMB_TEXT = _HOME;
    } else if ($cat > 0) {
        $breadcrumb_array = array();
        if ($cat >= FIRST_USER_CAT) {
            $user_name = get_username($cat - FIRST_USER_CAT);
            $user_id = get_userid($user_name);
            if ($user_id < 2) $user_name = 'Mr. X';

            $breadcrumb_array[] = array($cat, $user_name); //$row['user_name']
            $CURRENT_CAT_NAME = sprintf($lang_list_categories['xx_s_gallery'], $user_name);
            $row['parent'] = 1;
        } else {
            $result = db_query("SELECT catname, parent FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '$cat'");
            if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_cat'], __FILE__, __LINE__);
            $row = mysql_fetch_array($result);

            $breadcrumb_array[] = array($cat, $row['catname']);
            $CURRENT_CAT_NAME = $row['catname'];
            mysql_free_result($result);
        } while ($row['parent'] != 0) {
            $result = db_query("SELECT cid, catname, parent FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '{$row['parent']}'");
            if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['orphan_cat'], __FILE__, __LINE__);
            $row = mysql_fetch_array($result);

            $breadcrumb_array[] = array($row['cid'], $row['catname']);
            mysql_free_result($result);
        } // while
        // if (($album!='')&&(!is_numeric($album)){
        // $result = db_query("SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $album");
        // $row = mysql_fetch_array($result);
        // mysql_free_result($result);
        // $breadcrumb_array[] = array('', $lang_meta_album_names[$album]);
        // }
        $breadcrumb_array = array_reverse($breadcrumb_array);
        $breadcrumb = '<a class="statlink" href="' . $CPG_M_URL . '">' . _HOME . '</a>';
        $BREADCRUMB_TEXT = _HOME;

        foreach ($breadcrumb_array as $category) {
            $link = '<a class="statlink" href="' . $CPG_M_URL . '&cat=' . $category[0] . '">' . $category[1] . '</a>';
            $breadcrumb .= ' > ' . $link;
            $BREADCRUMB_TEXT .= ' > ' . $category[1];
        }
        // Add Link for album if $album is set
        if (is_numeric($album)) {
            $link = '<a class="statlink" href="' . $CPG_URL . '&file=thumbnails&album=' . $album . '>' . $CURRENT_ALBUM_DATA["title"] . '</a>';
            $breadcrumb .= ' > ' . $link;
            $BREADCRUMB_TEXT .= ' > ' . $CURRENT_ALBUM_DATA['title'];
        }
    }
}


(just replacing $CPG_URL with $CPG_M_URL - except for the call to thumbnails) and adding it to GLOBALS
Title: One more
Post by: eolica on December 03, 2003, 12:54:01 am
(I hope it will not be lost)

Now that I can go to categories, I've discovered another bug.
This happens when I want to go to User galleries:
Quote

There was an error while processing a database query.

While executing query "SELECT pn_uid, pn_uname, COUNT(DISTINCT a.aid) as alb_count, COUNT(DISTINCT pid) as pic_count, MAX(pid) as thumb_pid FROM nuke_users AS u INNER JOIN nuke_cpg_usergroups AS g ON user_group_cp = group_id INNER JOIN nuke_cpg_albums AS a ON category = 10000 + pn_uid LEFT JOIN nuke_cpg_pictures AS p ON (p.aid = a.aid AND approved = 'YES' ) GROUP BY user_id ORDER BY pn_uname" on 0

mySQL error: Unknown column 'user_id' in 'group statement'
Title: BUGS using with postnuke
Post by: DJMaze on December 03, 2003, 12:58:56 am
index.php line 224 or around that change
Code: [Select]
          "GROUP BY user_id ORDER BY $field_user_name";

into
Code: [Select]
          "GROUP BY $field_user_id ORDER BY $field_user_name";
Title: BUGS using with postnuke
Post by: eolica on December 03, 2003, 01:21:09 am
Of course it works!
Do you need more bugs?  :lol:
(I've them)
Title: BUGS using with postnuke
Post by: DJMaze on December 03, 2003, 01:46:50 am
as much as you can find
Title: BUGS using with postnuke
Post by: eolica on December 03, 2003, 02:00:13 am
Well.
One for you, fresh of ice:

Switching to User mode doesn't work. The "Leaving admin mode ..." screen appears, and clicking "continue" I'm back with the Admin menu buttons
Title: BUGS using with postnuke
Post by: DJMaze on December 03, 2003, 03:39:52 am
Ehm eolica i already solved thatone and a bunch more.
Including almost all header errors.

Shall i zip it up and send URL in a PM ?
Title: BUGS using with postnuke
Post by: eolica on December 03, 2003, 09:11:31 am
Yes, please
Title: Updated to 1.2.1
Post by: eolica on December 05, 2003, 11:47:16 pm
Just updated to 1.2.1 under postnuke .726

Can confirm that ALL the above bugs have been solved  :D

BIG Applause to the PHPnuke Dev Team  :!:  :!:  :!:

Now is time to go LIVE
Title: BUGS using with postnuke
Post by: DJMaze on December 06, 2003, 01:53:12 am
Thnx eolica :!:

Did you test in 714 as well ?

I didn't have time to install and try it yet.

I also downloaded a lot of CMS systems and gonna try to find differences (also xaraya)
Title: BUGS using with postnuke
Post by: eolica on December 06, 2003, 05:13:06 pm
It seems to work rather well also in .714 :D