41
intel352
Re: PayPal module
  • 2004/12/12 21:21

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


hhttp://dev.xoops.org/modules/xfmod/project/showfiles.php?group_id=1060&release_id=236#selected << xDonations v1.9 is available there.

ignore v1.4, it's quite buggy compared to 1.9.



42
intel352
Re: Need Help with MySQL syntax to merge two xoops_user tables
  • 2004/12/12 21:20

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


that should work. make sure you test first, lol.



43
intel352
Re: xoops_session table has 272 thousand rows
  • 2004/12/12 21:18

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


i'm quite sure it's supposed to be cleaned out automatically, not sure why it's not.

yes, empty the table, no harm will be caused (except a user currently logged in will haveta re-login most likely)



44
intel352
Re: Need Help with MySQL syntax to merge two xoops_user tables
  • 2004/12/12 10:18

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


my pleasure. again, make sure you update groups as well.




45
intel352
Re: Need Help with MySQL syntax to merge two xoops_user tables
  • 2004/12/12 10:11

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


make sure you run this via phpmyadmin

what were the changes you made? (post 'em?)



46
intel352
Re: Couple of questions on a couple of modules.
  • 2004/12/12 9:58

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


np

and, yes, i believe 2.1/2.2 is supposed to support extensible user tables (added profile/registration fields)



47
intel352
Re: Couple of questions on a couple of modules.
  • 2004/12/12 9:38

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


problem 1: goto blocks admin, click on Edit beside the Recent/Top News block, you can set the spotlight & teaser info there


problem 2: create a custom Block in the admin, set the type to PHP Code, and paste in the following code

include_once XOOPS_ROOT_PATH.'/include/functions.php';
global 
$xoopsConfig;
$db =& Database::getInstance();
$bannerobject '';
$bresult $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
list (
$numrows) = $db->fetchRow($bresult);
if ( 
$numrows ) {
    
$numrows $numrows-1;
    
mt_srand((double)microtime()*1000000);
    
$bannum mt_rand(0$numrows);
} else {
    
$bannum 0;
}
if ( 
$numrows ) {
    
$bresult $db->query("SELECT * FROM ".$db->prefix("banner"), 1$bannum);
list (
$bid$cid$imptotal$impmade$clicks$imageurl$clickurl$date$htmlbanner$htmlcode) = $db->fetchRow($bresult);
if (
$xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
        
// EMPTY
    
} else {
        
$db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u"$db->prefix("banner"), $bid));
}
    
/* Check if this impression is the last one and print the banner */
    
if ( $imptotal == $impmade ) {
        
$newid $db->genId($db->prefix("bannerfinish")."_bid_seq");
        
$sql sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)"$db->prefix("bannerfinish"), $newid$cid$impmade$clicks$datetime());
        
$db->queryF($sql);
        
$db->queryF(sprintf("DELETE FROM %s WHERE bid = %u"$db->prefix("banner"), $bid));
    }
    if (
$htmlbanner){
        
$bannerobject $htmlcode;
    }else{
    
$bannerobject '
.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" target="_blank">';
        if (
stristr($imageurl'.swf')) {
            
$bannerobject $bannerobject
                
.''
                
.'.$imageurl.'">'
                
.''
                
.'.$imageurl.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
                
.''
                
.'';
        } else {
            
$bannerobject $bannerobject.'.$imageurl.'" alt="" />';
        }

        
$bannerobject $bannerobject.'
'
;
}
echo 
$bannerobject;
}



problem 3: dunno



48
intel352
Re: Need Help with MySQL syntax to merge two xoops_user tables
  • 2004/12/12 9:18

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


change the database names accordingly. the table names should already correspond with the info that you gave me.

what this set of queries does, is creates a new table (ithq2_users), sets the uname and email fields to unique, inserts data from your 2 live tables into this new table

then, because the drop index query wouldn't work for me (to remove the unique user/email indexes), the queries create a new table called ithqFinal_users, transfers all data into that table (from ithq2_users), and then deletes ithq2_users

so, your finished user table will be ithqFinal_users. whenever you're ready to go, delete your existing xoops_users table and replace it with ithqFinal_users.

also, these queries do not take into account your members & their groups. if you want that data transferred as well, lemme know.

either way, you WILL have to create a query to add all users to the members group, otherwise they will not be able to access your sites appropriately.



DROP TABLE IF EXISTS `csmapce_dev.ithq2_users`;
CREATE TABLE `csmapce_dev.ithq2_users` (
  `
uidmediumint(8unsigned NOT NULL auto_increment,
  `
namevarchar(60NOT NULL default '',
  `
unamevarchar(25NOT NULL default '',
  `
emailvarchar(60NOT NULL default '',
  `
urlvarchar(100NOT NULL default '',
  `
user_avatarvarchar(30NOT NULL default 'blank.gif',
  `
user_regdateint(10unsigned NOT NULL default '0',
  `
user_icqvarchar(15NOT NULL default '',
  `
user_fromvarchar(100NOT NULL default '',
  `
user_sigtinytext NOT NULL,
  `
user_viewemailtinyint(1unsigned NOT NULL default '0',
  `
actkeyvarchar(8NOT NULL default '',
  `
user_aimvarchar(18NOT NULL default '',
  `
user_yimvarchar(25NOT NULL default '',
  `
user_msnmvarchar(100NOT NULL default '',
  `
passvarchar(32NOT NULL default '',
  `
postsmediumint(8unsigned NOT NULL default '0',
  `
attachsigtinyint(1unsigned NOT NULL default '0',
  `
ranksmallint(5unsigned NOT NULL default '0',
  `
leveltinyint(3unsigned NOT NULL default '1',
  `
themevarchar(100NOT NULL default '',
  `
timezone_offsetfloat(3,1NOT NULL default '0.0',
  `
last_loginint(10unsigned NOT NULL default '0',
  `
umodevarchar(10NOT NULL default '',
  `
uordertinyint(1unsigned NOT NULL default '0',
  `
notify_methodtinyint(1NOT NULL default '1',
  `
notify_modetinyint(1NOT NULL default '0',
  `
user_occvarchar(100NOT NULL default '',
  `
biotinytext NOT NULL,
  `
user_intrestvarchar(150NOT NULL default '',
  `
user_mailoktinyint(1unsigned NOT NULL default '1',
  
PRIMARY KEY  (`uid`),
  
KEY `uname` (`uname`),
  
KEY `email` (`email`),
  
KEY `uiduname` (`uid`,`uname`),
  
KEY `unamepass` (`uname`,`pass`)
TYPE=MyISAM;
ALTER TABLE `ithq2_usersADD UNIQUE (`uname`);
ALTER TABLE `ithq2_usersADD UNIQUE (`email`);
INSERT IGNORE INTO csmapce_dev.ithq2_usersname,
uname,
email,
url,
user_avatar,
user_regdate,
user_icq,
user_from,
user_sig,
user_viewemail,
actkey,
user_aim,
user_yim,
user_msnm,
pass,
posts,
attachsig,
rank,

LEVEL ,
theme,
timezone_offset,
last_login,
umode,
uorder,
notify_method,
notify_mode,
user_occ,
bio,
user_intrest,
user_mailok )
SELECT nameunameemailurluser_avataruser_regdateuser_icquser_fromuser_siguser_viewemailactkeyuser_aimuser_yimuser_msnmpasspostsattachsigrank
LEVEL themetimezone_offsetlast_loginumodeuordernotify_methodnotify_modeuser_occbiouser_intrestuser_mailok
FROM csmapce_dev
.ithq_users
UNION 

SELECT nameunameemailurluser_avataruser_regdateuser_icquser_fromuser_siguser_viewemailactkeyuser_aimuser_yimuser_msnmpasspostsattachsigrank
LEVEL themetimezone_offsetlast_loginumodeuordernotify_methodnotify_modeuser_occbiouser_intrestuser_mailok
FROM csmapce_dev
.demo_users
);
CREATE TABLE `csmapce_dev.ithqFinal_users` (
  `
uidmediumint(8unsigned NOT NULL auto_increment,
  `
namevarchar(60NOT NULL default '',
  `
unamevarchar(25NOT NULL default '',
  `
emailvarchar(60NOT NULL default '',
  `
urlvarchar(100NOT NULL default '',
  `
user_avatarvarchar(30NOT NULL default 'blank.gif',
  `
user_regdateint(10unsigned NOT NULL default '0',
  `
user_icqvarchar(15NOT NULL default '',
  `
user_fromvarchar(100NOT NULL default '',
  `
user_sigtinytext NOT NULL,
  `
user_viewemailtinyint(1unsigned NOT NULL default '0',
  `
actkeyvarchar(8NOT NULL default '',
  `
user_aimvarchar(18NOT NULL default '',
  `
user_yimvarchar(25NOT NULL default '',
  `
user_msnmvarchar(100NOT NULL default '',
  `
passvarchar(32NOT NULL default '',
  `
postsmediumint(8unsigned NOT NULL default '0',
  `
attachsigtinyint(1unsigned NOT NULL default '0',
  `
ranksmallint(5unsigned NOT NULL default '0',
  `
leveltinyint(3unsigned NOT NULL default '1',
  `
themevarchar(100NOT NULL default '',
  `
timezone_offsetfloat(3,1NOT NULL default '0.0',
  `
last_loginint(10unsigned NOT NULL default '0',
  `
umodevarchar(10NOT NULL default '',
  `
uordertinyint(1unsigned NOT NULL default '0',
  `
notify_methodtinyint(1NOT NULL default '1',
  `
notify_modetinyint(1NOT NULL default '0',
  `
user_occvarchar(100NOT NULL default '',
  `
biotinytext NOT NULL,
  `
user_intrestvarchar(150NOT NULL default '',
  `
user_mailoktinyint(1unsigned NOT NULL default '1',
  
PRIMARY KEY  (`uid`),
  
KEY `uname` (`uname`),
  
KEY `email` (`email`),
  
KEY `uiduname` (`uid`,`uname`),
  
KEY `unamepass` (`uname`,`pass`)
TYPE=MyISAM;
INSERT IGNORE INTO csmapce_dev.ithqFinal_usersname,
uname,
email,
url,
user_avatar,
user_regdate,
user_icq,
user_from,
user_sig,
user_viewemail,
actkey,
user_aim,
user_yim,
user_msnm,
pass,
posts,
attachsig,
rank,

LEVEL ,
theme,
timezone_offset,
last_login,
umode,
uorder,
notify_method,
notify_mode,
user_occ,
bio,
user_intrest,
user_mailok )
SELECT nameunameemailurluser_avataruser_regdateuser_icquser_fromuser_siguser_viewemailactkeyuser_aimuser_yimuser_msnmpasspostsattachsigrank
LEVEL themetimezone_offsetlast_loginumodeuordernotify_methodnotify_modeuser_occbiouser_intrestuser_mailok
FROM csmapce_dev
.ithq2_users;
DROP TABLE IF EXISTS `csmapce_dev.ithq2_users`;



49
intel352
Re: Need Help with MySQL syntax to merge two xoops_user tables
  • 2004/12/12 7:55

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


sorry brash, i forgot about this
imma hop right onto it.

and yes, the modified code that ptp posted is not what you need, it's geared for replacing the existing user table with data from another user table. there's also some needless code in there (regarding the date field and whatnot, phpnuke had used string method to store the date, i had to convert that to xoops' int, but xoops->to->xoops doesn't require that conversion)

anywho, i'll post something in a whee bit.

EDIT: and for christian's query, you haveta make sure your MySQL database version is 4.0+



50
intel352
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2004/12/9 15:18

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


nice fix ackbarr




TopTop
« 1 2 3 4 (5) 6 7 8 ... 69 »



Login

Who's Online

177 user(s) are online (68 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits