Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3   Go Down

Author Topic: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!  (Read 60747 times)

0 Members and 1 Guest are viewing this topic.

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« on: January 29, 2006, 08:53:01 pm »

##############################################################
## MOD Title: JUpload Mod
## MOD Author: mstralka < your_email > (Mark Stralka) http://www.photo-junky.com Edited AWJunkies aellis@awjunkies.com
## MOD Description: This allows users to upload multiple pictures
## easily, even if they do not have Windows XP.  It is a Java applet
## MOD Version: 2.5.0
## MODED by AWJunkies to work with 1.4.x
## Installation Level: Beginner
## Installation Time: 5 Minutes
## Files To Edit: lang/english.php, groupmgr.php, includes/init.inc.php, bridge/coppermine.inc.php
## Included Files: (upload.php)
##############################################################
##############################################################
## Author Notes: Download and install jupload from http://jupload.biz
## Put JUpload.jar in the same directory as your coppermmine files or modify
## function jupload_applet() to point to it
## I recommend you install my Multiple Edit mod first:
## http://forum.coppermine-gallery.net/index.php?topic=9391.msg125116#msg125116 DO NOT DO THE upload.php edits when using the below upload file or follow along and edit the edit all at once mod changes.
##############################################################
## MOD History:
##   2006-03-27 - Version 1.5.0 Edited by AWJunkies
##   2004-07-25 - Version 1.0.0
##      - Initial release, required separate files
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

[edit GauGau 2006-01-29]
Split this thread that deals with the JUpload mod for cpg1.4.x from the "original" thread "Cross-platform Batch Uploading" that was made for cpg1.3.x
Thanks for the contrib.
[/edit]

##Database modifications
Code: [Select]
ALTER TABLE `cpg143_usergroups` ADD `can_use_jupload` TINYINT( 4 ) DEFAULT '0' NOT NULL ;

!EDIT ALL AT ONCE MOD:
Code: [Select]
INSERT INTO `cpg143_config` ( `name` , `value` )
VALUES (
'allow_assign_multiple_photos', '0'
);

Adding this code will create a Yes/No option on the CONFIG page, under User Settings.  The default value
is No, which means uploads will work just like they do now.  Setting it to Yes will turn on the mod.
lang/english.php
FIND:
Code: [Select]
  'User settings',
  array('Allow new user registrations', 'allow_user_registration', 1),
  array('User registration requires email verification', 'reg_requires_valid_email', 1),
ADD to end of User Settings section:
Code: [Select]
  array('Allow users to assign uploaded photos at once (instead of one-at-a-time)','allow_assign_multiple_photos',1), //Mark Stralka cpg1.3.2
END OF EDIT ALL AT ONCE MOD!

lang/english.php
FIND:
Code: [Select]
if (defined('UPLOAD_PHP')) $lang_upload_php = array(
ADD:
Code: [Select]
  'jupload_title' => 'Upload multiple photos', //JUpload MOD

Find:
Code: [Select]
if (defined('GROUPMGR_PHP')) $lang_groupmgr_php = array(
add this line to the array:
Code: [Select]
'can_use_jupload' => 'Can use JUpload',

USE MY ATTACHED upload.txt instead of doing all thee upload.php edits! AWJunkies

groupmgr.php - groups need to have permission to use JUPLOAD - added permission field 'can_use_jupload'
FIND:
Code: [Select]
$field_list = array('can_rate_pictures', 'can_send_ecards', 'can_post_comments', 'can_upload_pictures', 'pub_upl_need_approval', 'can_create_albums', 'priv_upl_need_approval');
Replace With:
Code: [Select]
$field_list = array('can_rate_pictures', 'can_send_ecards', 'can_post_comments', 'can_upload_pictures', 'pub_upl_need_approval', 'can_create_albums', 'priv_upl_need_approval', 'can_use_jupload');

FIND:
Code: [Select]
function process_post_data()
{
    global $CONFIG;

    $field_list = array('group_name', 'group_quota', 'can_rate_pictures', 'can_send_ecards', 'can_post_comments', 'can_upload_pictures', 'pub_upl_need_approval', 'can_create_albums', 'priv_upl_need_approval', 'upload_form_config', 'custom_user_upload', 'num_file_upload', 'num_URI_upload');
Replace With:
Code: [Select]
function process_post_data()
{
    global $CONFIG;
    //added 'can_use_jupload'
    $field_list = array('group_name', 'group_quota', 'can_rate_pictures', 'can_send_ecards', 'can_post_comments', 'can_upload_pictures', 'pub_upl_need_approval', 'can_create_albums', 'priv_upl_need_approval', 'can_use_jupload','upload_form_config', 'custom_user_upload', 'num_file_upload', 'num_URI_upload');

FIND:
Code: [Select]
            elseif ($field_name=='priv_upl_need_approval') {
                echo $tr_start.$td_start.$lang_groupmgr_php['approval'].$td_end;
            }
After ADD:
Code: [Select]
            //JUpload MOD
            elseif ($field_name=='can_use_jupload') {
                echo $tr_start.$td_start.$lang_groupmgr_php['can_use_jupload'].$td_end;
            }

bridge/coppermine.inc.php (if you have a bridged version you "MAY" need to put this in the bridge file session extraction or cookie extraction)
FIND:
Code: [Select]
return ($id) ? array($id, $pass) : false;Add before:
Code: [Select]
if (isset($_GET['cookie'])) {
$USER = @unserialize(@base64_decode($_GET['cookie']));
    $id = $USER[$CONFIG['cookie_name'].'_uid'];
$pass = $USER[$CONFIG['cookie_name'].'_pass'];
}
if (!$pass) return false;

bridge/udb_base.inc.php - added new config variable USER_CAN_USE_JUPLOAD
FIND:
Code: [Select]
define('USER_ID', $USER_DATA['user_id']);
        define('USER_NAME', addslashes($USER_DATA['user_name']));
        define('USER_GROUP', $USER_DATA['group_name']);
        define('USER_GROUP_SET', $user_group_set);
        define('USER_IS_ADMIN', $USER_DATA['has_admin_access']);
        define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
        define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
        define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
        define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
        define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
        define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
        define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
        define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
        define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);
Replace With:
Code: [Select]
define('USER_ID', $USER_DATA['user_id']);
        define('USER_NAME', addslashes($USER_DATA['user_name']));
        define('USER_GROUP', $USER_DATA['group_name']);
        define('USER_GROUP_SET', $user_group_set);
        define('USER_IS_ADMIN', $USER_DATA['has_admin_access']);
        define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
        define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
        define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
        define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
        define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
        define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
        define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
//JUpload Modification Mark Stralka 7/25/2004
define('USER_CAN_USE_JUPLOAD', (int)$USER_DATA['can_use_jupload']);
        define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
        define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);

FIND:
Code: [Select]
            $result = cpg_db_query("SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, " .
                            "MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, " .
                            "MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, " .
                            "MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, " .
                            "MAX(num_URI_upload) as num_URI_upload, " .
                            "MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, " .
                            "MAX(can_create_albums) as can_create_albums, " .
                            "MAX(has_admin_access) as has_admin_access, " .
                            "MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval, ".
                            "FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id in (" .  implode(",", $groups). ")");
Replace With:
Code: [Select]
            $result = cpg_db_query("SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, " .
                            "MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, " .
                            "MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, " .
                            "MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, " .
                            "MAX(num_URI_upload) as num_URI_upload, " .
                            "MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, " .
                            "MAX(can_create_albums) as can_create_albums, " .
                            "MAX(has_admin_access) as has_admin_access, " .
                            "MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval, ".
                            //JUpload MOD
                            "MAX(can_use_jupload) as can_use_jupload " .
                            "FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id in (" .  implode(",", $groups). ")");
« Last Edit: March 31, 2006, 08:24:20 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Cross-platform Batch Uploading (cpg1.4.x)
« Reply #1 on: January 30, 2006, 12:16:01 am »

@Adam: is your question you sent by PM still valid? If yes, please post it publicly.
Logged

sundelius

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Cross-platform Batch Uploading (cpg1.4.x) CASH $ REWARD!
« Reply #2 on: March 11, 2006, 08:15:58 pm »

Anyone got this to work yet?
I cannot get it to work with Jupload...
Logged

iblazed

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) CASH $ REWARD!
« Reply #3 on: March 15, 2006, 05:24:24 am »

I would also be very intrested in knowing if anyone got this working. This would be a great mod to have.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) CASH $ REWARD!
« Reply #4 on: March 25, 2006, 11:08:09 pm »

WOOT I got it to work! Fully functional. Thanks to guice for the help! Look to post #1 for all instructions.
« Last Edit: March 28, 2006, 07:23:52 pm by AWJunkies »
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #5 on: March 28, 2006, 03:59:17 am »

looks like there is a problem with the uploaded upload.txt file, it ends on line 2844 with:

Code: [Select]
    $captionLabel = $lang_upload_php['
I think there is ment to be more after this, right?

(gallery gives error: Parse error: syntax error, unexpected $end in /home/.bellow/stevie46j/stevieandamys.com/gallery/upload.php on line 2858)

I tried finishing off the file with the contents of your old upload.txt file, but then the gallery gives:

(http://imageimp.com/uploads/7b4d44219b.jpg)

i have been waiting for this mod to be finished for some time, thanks for all your work.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #6 on: March 28, 2006, 07:30:49 pm »

It is something to do with the attachment MOD on this site. I am viewing the upload.txt file on my computer and it has complete code. But when I upload it to the server it cuts it off at that line.? Please someone help figure out why it is doing that.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #7 on: March 28, 2006, 07:34:24 pm »

OK fixed it! It had to do with how I was saving it. I saved it as UNIX platform not PC .txt file. So somehow it was messing with the attachment mod upload system. Well happy downloading! :)
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #8 on: March 28, 2006, 08:06:03 pm »

Thats great, the problem is my end, but hoping you can fix it for me.

I am still getting the error above (the pic one), here it is in more detail:

(http://imageimp.com/uploads/aacec93953.jpg)

I think this is because my server is using Mysql 5.0, and it is line 786 of upload.php which is causing the error. line 786 is:

Code: [Select]
    $result = cpg_db_query("SELECT username, user_password AS password, user_id AS userid " . "FROM {$CONFIG['NUKE_USERS']} " . "WHERE user_id ='" . USER_ID . "' ");
i was hoping that you may be able to make it mysql 5.1 compatable?

Thanks again.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #9 on: March 28, 2006, 11:30:50 pm »

OOPS I didn't realize there was nuke stuff in there let me fix that. Give me a bit upgrading to 1.4.4 manuely and change the upload.txt file.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #10 on: March 29, 2006, 11:28:12 pm »

Fixed it should work for all bridging now. Let me know if you get any issues. Works perfect for me.
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #11 on: March 30, 2006, 01:22:25 am »

All loads up fine now, but once the files have been uploaded i still get errors when it tries to redirect to the next page. There are two different errors that appear. At first i get this:

(http://imageimp.com/uploads/32450490dc.jpg)

I have checked all permisions in group manager and i have them all correct, i am logged in as Admin (same happens on a users account)

But then if i go back and try the upload again, i get this (firefox error):

(http://imageimp.com/uploads/4c92a25d1b.jpg)

if i restart firefox, it goes back to the first error again.

Some more info:

Browser: Firefox (same happens in IE)
Server: UNIX
PHP Version: 5.1.2
MySql Version: 5.0.16
Bridged with: Invision Power Board 2.1.4
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #12 on: March 30, 2006, 02:46:07 am »

Ok I am not sure what your bridge values are for username and user_id etc if it does NOT match then it will throw that error or time out.

Check line 786-797 from upload.txt and make sure this works with your bridge.

Code: [Select]
    $result = cpg_db_query("SELECT username, user_password AS password, user_id AS userid " . "FROM {$CONFIG['NUKE_USERS']} " . "WHERE user_id ='" . USER_ID . "' ");
    $user_data = mysql_fetch_array($result);
    mysql_free_result($result);

$pass = $user_data['password'];
// $username = $user_data['username'];
$userid = $user_data['userid'];

// $_COOKIE[$CONFIG['cookie_name'].'_uname'] = $username;
$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $userid;
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $pass;
$cookieEnc = base64_encode(serialize($_COOKIE));
Above is what mine shows with manuel push to user table. I am changing it to flow with bridge right now but my bridge. Hense the changes with the new upload.txt file that you just got. You will need to look back at your bridge file info for those variables or change them totaly to {$f[blah blah stuff to make it work. I will make the necisary changes for you if you can't figure it out by tomorrow. I am leaving the office right now.

Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #13 on: March 30, 2006, 03:45:39 am »

i have tried several things, but none of them have worked for me, so some extra help would be great.

My current code in upload.php at that point is:

Code: [Select]
    $result = cpg_db_query("SELECT user_password, user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_id ='" . USER_ID . "' ");
    $user_data = mysql_fetch_array($result);
    mysql_free_result($result);

$pass = $user_data['user_password'];
$userid = $user_data['user_id'];

$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $userid;
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $pass;
$cookieEnc = base64_encode(serialize($_COOKIE));

and the code in my bridge file (im pretty sure this has to be "invisionboard20.inc.php", for invision power board 2.1 right?) is:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.4
  $Source: /cvsroot/coppermine/stable/bridge/invisionboard20.inc.php,v $
  $Revision: 1.4 $
  $Author: gaugau $
  $Date: 2006/02/18 10:11:27 $
**********************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Switch that allows overriding the bridge manager with hard-coded values
define('USE_BRIDGEMGR'1);

require_once 
'bridge/udb_base.inc.php';

class 
cpg_udb extends core_udb {

function cpg_udb()
{
global $BRIDGE;

if (!USE_BRIDGEMGR) {
$this->boardurl 'http://localhost/ipb';
require_once('../ipb/conf_global.php');
$this->use_post_based_groups 0;
} else {
require_once($BRIDGE['relative_path_to_config_file'] . '/conf_global.php');
$this->boardurl $INFO['board_url'];
$this->use_post_based_groups $BRIDGE['use_post_based_groups'];
}

// Database connection settings
$this->db = array(
'name' => $INFO['sql_database'],
'host' => $INFO['sql_host'] ? $INFO['sql_host'] : 'localhost',
'user' => $INFO['sql_user'] ,
'password' => $INFO['sql_pass'],
'prefix' =>$INFO['sql_tbl_prefix']
);

// Board table names
$this->table = array(
'users' => 'members',
'groups' => 'groups',
'sessions' => 'sessions'
);

// Derived full table names
$this->usertable '`' $this->db['name'] . '`.' $this->db['prefix'] . $this->table['users'];
$this->groupstable =  '`' $this->db['name'] . '`.' $this->db['prefix'] . $this->table['groups'];
$this->sessionstable =  '`' $this->db['name'] . '`.' $this->db['prefix'] . $this->table['sessions'];

// Table field names
$this->field = array(
'username' => 'name'// name of 'username' field in users table
'user_id' => 'id'// name of 'id' field in users table
'password' => 'member_login_key'// name of 'password' field in users table
'email' => 'email'// name of 'email' field in users table
'regdate' => 'joined'// name of 'registered' field in users table
'location' => "''"// name of 'location' field in users table
'website' => "''"// name of 'website' field in users table
'usertbl_group_id' => 'mgroup'// name of 'group id' field in users table
'grouptbl_group_id' => 'g_id'// name of 'group id' field in groups table
'grouptbl_group_name' => 'g_title' // name of 'group name' field in groups table
);

// Pages to redirect to
$this->page = array(
'register' => '/index.php?act=Reg&CODE=00',
'editusers' => '/admin.php',
'edituserprofile' => '/index.php?showuser='
);


// Group ids - admin and guest only.
$this->admingroups = array($this->use_post_based_groups $INFO['admin_group'] : 1);
$this->guestgroup $this->use_post_based_groups $INFO['guest_group']+100 3;

// Connect to db
$this->connect();
}

// definition of how to extract id, pass from session cookie
function session_extraction()
{
if (isset($_COOKIE['session_id'])) {
$session_id addslashes($_COOKIE['session_id']);

$sql "SELECT member_id , member_login_key FROM {$this->sessionstable} AS s INNER JOIN {$this->usertable} AS u ON s.member_id = u.id WHERE s.id = '$session_id'";

$result cpg_db_query($sql$this->link_id);

if (mysql_num_rows($result)){
$row mysql_fetch_array($result);
return $row;
}
} else {
return false;
}
}

// definition of how to extract an id and password hash from a cookie
function cookie_extraction()
{
    $id 0;
$pass '';

if (isset($_COOKIE['member_id']) && isset($_COOKIE['pass_hash'])) {
$id = (int)$_COOKIE['member_id'];
$pass substr(addslashes($_COOKIE['pass_hash']), 032);
}
if (isset($_GET['cookie'])) {
$USER = @unserialize(@base64_decode($_GET['cookie']));
     $id $USER[$CONFIG['cookie_name'].'_uid'];
$pass $USER[$CONFIG['cookie_name'].'_pass'];
}
if (!$pass) return false;

return ($id) ? array($id$pass) : false;
}

// definition of actions required to convert a password from user database form to cookie form
function udb_hash_db($password)
{
return $password// unused
}

function login_page()
{
$this->redirect("/index.php?act=Login&CODE=00");
}

function logout_page()
{
$this->redirect("/index.php?act=Login&CODE=06");
}
}

// and go !
$cpg_udb = new cpg_udb;

Thanks again.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #14 on: March 30, 2006, 06:40:40 am »

Your invision board code!!!!

Code: [Select]
$this->field = array(
'username' => 'name', // name of 'username' field in users table
'user_id' => 'id', // name of 'id' field in users table
'password' => 'member_login_key', // name of 'password' field in users table

So you need to change username and user_id in upload.php file to match. SO need to do this.

FIND:
Code: [Select]
    $result = cpg_db_query("SELECT user_password, user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_id ='" . USER_ID . "' ");
    $user_data = mysql_fetch_array($result);
    mysql_free_result($result);

$pass = $user_data['user_password'];
$userid = $user_data['user_id'];

$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $userid;
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $pass;
$cookieEnc = base64_encode(serialize($_COOKIE));

REPLACE WITH
Code: [Select]
    $result = cpg_db_query("SELECT member_login_key, id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE id ='" . USER_ID . "' ");
    $user_data = mysql_fetch_array($result);
    mysql_free_result($result);

$pass = $user_data['member_login_key'];
$userid = $user_data['id'];

$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $userid;
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $pass;
$cookieEnc = base64_encode(serialize($_COOKIE));

This should work now if not you need to change {$CONFIG['TABLE_USERS']} to whatever your user table is ( $this->usertable ).
I will have an universal bridge fix sometime tomorrow. Putting together our race car before Formula D in Long Beach.
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #15 on: March 30, 2006, 07:18:01 am »

ok, so now i have this in upload.php:

Code: [Select]
        $result = cpg_db_query("SELECT member_login_key, id " . "FROM ibf_members " . "WHERE id ='" . USER_ID . "' ");
    $user_data = mysql_fetch_array($result);
    mysql_free_result($result);

$pass = $user_data['member_login_key'];
$userid = $user_data['id'];

$_COOKIE[$CONFIG['cookie_name'].'_uid'] = $userid;
$_COOKIE[$CONFIG['cookie_name'].'_pass'] = $pass;
$cookieEnc = base64_encode(serialize($_COOKIE));

, and still have the same problem that it completely forgets what user i am after uploading the files using jupload:

(http://imageimp.com/uploads/1c5e42862a.jpg)

any more ideas on this?  ???
« Last Edit: March 30, 2006, 07:23:24 am by steve46 »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #16 on: March 30, 2006, 06:19:25 pm »

IS your coppermine and invision on the same database? If not then the " FROM ibf_members " wont work. Give me a bit to do the universal bridge fix one for ya. I am just mad busy right now putting together the race car that has to be to LA tomorrow at 5pm.
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #17 on: March 30, 2006, 11:13:12 pm »

yeah there all on the same database, if they werent then i would get a mysql error before the upload.php page even loads jupload.

no, worries, i can wait for this, just hope to be able to have it in the future.

Good luck with the car.

[UPDATE]

got more info for you, (by enabling debug mode to everyone). This comes up after i have used jupload to upload the photos, (once the page has been forwarded):

(http://imageimp.com/uploads/c8b5509ab3.jpg)

I think the notices at the bottom show what the problem is. Line 113-131 in invisionboard20.inc.php are:

Code: [Select]
// definition of how to extract an id and password hash from a cookie
function cookie_extraction()
{
    $id = 0;
$pass = '';

if (isset($_COOKIE['member_id']) && isset($_COOKIE['pass_hash'])) {
$id = (int)$_COOKIE['member_id'];
$pass = substr(addslashes($_COOKIE['pass_hash']), 0, 32);
}
if (isset($_GET['cookie'])) {
$USER = @unserialize(@base64_decode($_GET['cookie']));
    $id = $USER[$CONFIG['cookie_name'].'_uid'];
$pass = $USER[$CONFIG['cookie_name'].'_pass'];
}
if (!$pass) return false;

return ($id) ? array($id, $pass) : false;
}
« Last Edit: March 31, 2006, 01:18:36 am by steve46 »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #18 on: March 31, 2006, 03:44:41 am »

Put THIS:
Code: [Select]
if (isset($_GET['cookie'])) {
$USER = @unserialize(@base64_decode($_GET['cookie']));
    $id = $USER[$CONFIG['cookie_name'].'_uid'];
$pass = $USER[$CONFIG['cookie_name'].'_pass'];
}
if (!$pass) return false;
after extract session not extract cookie. That is how I have mine and it does work. It doesn't work in extract cookies section. I was just doing it on the fly that bridged people would probably be able to put it in the cookies section and not sessions. Make it easy on yourself and put it in the sessions. Cookies extraction section is ONLY used when first crossing over from invision board to coppermine. Once in coppermine it uses sessions. OR if set shared sessions linked then you never really use the cookie extraction. I will change the code above. That will help you, now make the same changes you have been with the upload.php. It should work! Sorry still building this car no time to double check any of this just doing it on the fly. You can contact me through AIM= AWJunkies and I can help you a LOT more. I will make an universal one when i get the chance. If you want to see it working with 1.4.x version (tested on 1.4.3 and 1.4.4) go here:

www.allwheelphotos.com
« Last Edit: March 31, 2006, 03:50:40 am by AWJunkies »
Logged

fayoeu

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • neophoto.org
Re: Cross-platform Batch Uploading (cpg1.4.x) COMPLETED!
« Reply #19 on: April 23, 2006, 08:18:20 am »

OK fixed it! It had to do with how I was saving it. I saved it as UNIX platform not PC .txt file. So somehow it was messing with the attachment mod upload system. Well happy downloading! :)

I am still having problems downloading the upload.txt file from here. it seems to be truncated. Here is the last thing I see:

Code: [Select]
   5691     //Use the IPTC title or headline for the Coppermine title if available.^M
   5692
   5693     if (isset($iptc['Title']) && !empty($iptc['Title'])) {^M
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.029 seconds with 20 queries.