1
rts2271
Thought I'd mention my provider
  • 2008/10/24 4:23

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


Fatjack Hosting
Been with em for years. Rarely a outage or issue. Support is capable and thorough. They have a couple of staff members very well versed in XOOPS and XOOPS issue as well as for high performance sites. You can get a decent install performance on there 9 buck package. That's what I started out with, but I'm using there VPS now as I outgrew the shared account.
Overall very happy with their service.

http://fatjackhosting.com



2
rts2271
We need a custom shopping cart / affiliate program
  • 2007/5/3 20:08

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


We are seeking php developers to build
a custom shopping cart / affiliate / crm program application module.
The application must be object based and run off the
Xoops API. www.xoops.org . The software must be well documented
and API compliant. This application will follow a set of
software standards created by our internal development team
for your team to use. The cart and affiliate manager should
be full featured modules with interaction with payment gateways
and a mechanism to pass calls securely outside of the
module(SOAP or XML). There should be few to no hacks needed
for the core API.

Examples
1shoppingcart
infusion
kickstartcart
Contact myself at ralph@fatjackhosting.com if you are interested.



3
rts2271
My evolving multisite method
  • 2005/12/20 15:51

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


I took some time and worked out something that works for me for what I need a multi-site system. I did'nt have much luck with the module doing what I needed it to so I improvised one here.Mind you this isnt a trusted solution and is better suited for a single owner of the shared site system. I am posting this up for suggestions not as a suggestion and no not know how far I'm going to develop this past the working point.
That said on to my ramblings.

First I altered the mainfile structure. Changing it to WWW.DOMAINNAME.COM for each subdomain or domain I wished to share the codebase with. Each is set up with its on complete db install at this time. In my case it was a replica of my db and then cut up into individual data sets relating to content type after install.
In my case I have WWW.DOMAINNAME.COM WWW2.DOMAINNAME.COM DOMAINNAME.COM as 3 configuration files placed apropriately.
My first change to index.php was to add this snipet at the top to build the configuration file include or choose default.

foreach ($_SERVER as $k => $v){
if($k=='HTTP_HOST'){
$SName=$v;
}
}
if (!(empty($SName)))
{
include($SName.".php");
}else{
include("default.main.php");
}

Badda Bing configuration file is is generated from the response to the $_SERVER['HTTP_HOST'].
The next thing we have to do is go into common.php and make a couple of changes.
First is to again pickup the HTTP_HOST value.
foreach ($_SERVER as $k => $v){
if($k=='HTTP_HOST'){
$SName=$v;
}
}

I changed the directory structure of
cache
uploads
templates_c
Each subdomain gets it's own directory inside there original
individual respected directories i.e. ../cache/WWW.DOMAINNAME.COM
In common.php I made these changes.
define("XOOPS_CACHE_PATH", XOOPS_ROOT_PATH."/cache/".$SName."/");
define("XOOPS_UPLOAD_PATH", XOOPS_ROOT_PATH."/uploads".$SName."/");
define("XOOPS_THEME_PATH", XOOPS_ROOT_PATH."/themes");
define("XOOPS_COMPILE_PATH", XOOPS_ROOT_PATH."/templates_c/".$SName."/");
define("XOOPS_THEME_URL", XOOPS_URL."/themes");
define("XOOPS_UPLOAD_URL", XOOPS_URL."/uploads/".$SName);

Now the new altered director structure and configuration files are in place we can move on to the more tedious stuff.
One of the first things your going to say is Oh Noes!!11!! I borked the site cause now anything the references the mainfile is going to need some asjustments.

** NOTE** The one thing I've noticed is that most Core modules as well as well coded 3rd party modules only need this change made in one place per module. Poorly coded modules have it in milions of places. Be warned **

Anywhere the call for mainfile.php comes up has to be changed.Here's my alteration which I am more then likely gonna functionalize.

foreach ($_SERVER as $k => $v){
if($k=='HTTP_HOST'){
$SName=$v;
}
}
if (!(empty($SName)))
{
include($SName.".php");
}else{
include("default.main.php");
}

The easiest way is have a good folder search tool and find all files with mainfile.php in there contents and replace the include with the above sniptet or a call method of your own design.

Now this allows multiple seperate db sites but hey wtf we got that already. Very true. Theres no point to reinventing the wheel. However were not done yet. Were going to move to sharing of user and session data between all the websites. In the kernel file user.php I hard coded the db information i.e. anywhere in user.php with this...
$this->db->prefix("users")
I changed it to DB.PREFIX.TABLE
Example
/**
* retrieve a user
*
* @param int $id UID of the user
* @return mixed reference to the {@link XoopsUser} object, FALSE if failed
*/
function &get($id)
{
if (intval($id) > 0) {
$sql = 'SELECT * FROM DB.PREFIX.TABLE WHERE uid='.$id;
if (!$result = $this->db->query($sql)) {
return false;
}
$numrows = $this->db->getRowsNum($result);
if ($numrows == 1) {
$user = new XoopsUser();
$user->assignVars($this->db->fetchArray($result));
return $user;
}
}
return false;
}

/**
* insert a new user in the database
*
* @param object $user reference to the {@link XoopsUser} object
* @param bool $force
* @return bool FALSE if failed, TRUE if already present and unchanged or successful
*/
function insert(&$user, $force = false)
{
if (strtolower(get_class($user)) != 'xoopsuser') {
return false;
}
if (!$user->isDirty()) {
return true;
}
if (!$user->cleanVars()) {
return false;
}
foreach ($user->cleanVars as $k => $v) {
${$k} = $v;
}
// RMV-NOTIFY
// Added two fields, notify_method, notify_mode
if ($user->isNew()) {
$uid = $this->db->genId($this->db->prefix('users').'_uid_seq');
$sql = sprintf("INSERT INTO DB.PREFIX.TABLE (uid, uname, name, 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, steamid) VALUES (%u, %s, %s, %s, %s, %s, %u, %s, %s, %s, %u, %s, %s, %s, %s, %s, %u, %u, %u, %u, %s, %.2f, %u, %s, %u, %u, %u, %s, %s, %s, %u, %s)", $uid, $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), time(), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($actkey), $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $this->db->quoteString($pass), $posts, $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, 0, $this->db->quoteString($umode), $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok, $this->db->quoteString($steamid));
} else {
$sql = sprintf("UPDATE DB.PREFIX.TABLE SET uname = %s, name = %s, email = %s, url = %s, user_avatar = %s, user_icq = %s, user_from = %s, user_sig = %s, user_viewemail = %u, user_aim = %s, user_yim = %s, user_msnm = %s, posts = %d, pass = %s, attachsig = %u, rank = %u, level= %u, theme = %s, timezone_offset = %.2f, umode = %s, last_login = %u, uorder = %u, notify_method = %u, notify_mode = %u, user_occ = %s, bio = %s, user_intrest = %s, user_mailok = %u, steamid = %s WHERE uid = %u", $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $posts, $this->db->quoteString($pass), $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, $this->db->quoteString($umode), $last_login, $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok, $this->db->quoteString($steamid), $uid);
}
if (false != $force) {
$result = $this->db->queryF($sql);
} else {
$result = $this->db->query($sql);
}
if (!$result) {
return false;
}
if (empty($uid)) {
$uid = $this->db->getInsertId();
}
$user->assignVar('uid', $uid);
return true;
}

/**
* delete a user from the database
*
* @param object $user reference to the user to delete
* @param bool $force
* @return bool FALSE if failed.
*/
function delete(&$user, $force = false)
{
if (strtolower(get_class($user)) != 'xoopsuser') {
return false;
}
$sql = sprintf("DELETE FROM DB.PREFIX.TABLE WHERE uid = %u", $user->getVar('uid'));
if (false != $force) {
$result = $this->db->queryF($sql);
} else {
$result = $this->db->query($sql);
}
if (!$result) {
return false;
}
return true;
}

/**
* retrieve users from the database
*
* @param object $criteria {@link CriteriaElement} conditions to be met
* @param bool $id_as_key use the UID as key for the array?
* @return array array of {@link XoopsUser} objects
*/
function &getObjects($criteria = null, $id_as_key = false)
{
$ret = array();
$limit = $start = 0;
$sql = 'SELECT * FROM DB.PREFIX.TABLE';
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
if ($criteria->getSort() != '') {
$sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
}
$limit = $criteria->getLimit();
$start = $criteria->getStart();
}
$result = $this->db->query($sql, $limit, $start);
if (!$result) {
return $ret;
}
while ($myrow = $this->db->fetchArray($result)) {
$user = new XoopsUser();
$user->assignVars($myrow);
if (!$id_as_key) {
$ret[] =& $user;
} else {
$ret[$myrow['uid']] =& $user;
}
unset($user);
}
return $ret;
}

/**
* count users matching a condition
*
* @param object $criteria {@link CriteriaElement} to match
* @return int count of users
*/
function getCount($criteria = null)
{
$sql = 'SELECT COUNT(*) FROM DB.PREFIX.TABLE';
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
}
$result = $this->db->query($sql);
if (!$result) {
return 0;
}
list($count) = $this->db->fetchRow($result);
return $count;
}

/**
* delete users matching a set of conditions
*
* @param object $criteria {@link CriteriaElement}
* @return bool FALSE if deletion failed
*/
function deleteAll($criteria = null)
{
$sql = 'DELETE FROM DB.PREFIX.TABLE';
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
}
if (!$result = $this->db->query($sql)) {
return false;
}
return true;
}

/**
* Change a value for users with a certain criteria
*
* @param string $fieldname Name of the field
* @param string $fieldvalue Value to write
* @param object $criteria {@link CriteriaElement}
*
* @return bool
**/
function updateAll($fieldname, $fieldvalue, $criteria = null)
{
$set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
$sql = 'UPDATE DB.PREFIX.TABLE SET '.$set_clause;
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
}
if (!$result = $this->db->query($sql)) {
return false;
}
return true;
}

This sets the user db to one single defined db between multiple db's. I'm sure theres a better way to aproach this and I'm going to try to figure out how to make less changes to this file.
Next I did some session changes because I was trying to make all domains share session data for single sign on. Havent had much luck so I'll post this up saying it sucks and only half assed works. It closes the session in 15 minutes without fail lol doesnt clean up well either. I'm gonna make this my next priority.
function read($sess_id)
{
$sql = sprintf('SELECT sess_data FROM DB.PREFIX.TABLE WHERE sess_id = %s', $this->db->quoteString($sess_id));
if (false != $result = $this->db->query($sql)) {
if (list($sess_data) = $this->db->fetchRow($result)) {
return $sess_data;
}
}
return '';
}

/**
* Write a session to the database
*
* @param string $sess_id
* @param string $sess_data
*
* @return bool
**/
function write($sess_id, $sess_data)
{
$sess_id = $this->db->quoteString($sess_id);
list($count) = $this->db->fetchRow($this->db->query("SELECT COUNT(*) FROM DB.PREFIX.TABLE WHERE sess_id=".$sess_id));
if ( $count > 0 ) {
$sql = sprintf('UPDATE DB.PREFIX.TABLE SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', time(), $this->db->quoteString($sess_data), $sess_id);
} else {
$sql = sprintf('INSERT INTO DB.PREFIX.TABLE (sess_id, sess_updated, sess_ip, sess_data) VALUES (%s, %u, %s, %s)', $sess_id, time(), $this->db->quoteString($_SERVER['REMOTE_ADDR']), $this->db->quoteString($sess_data));
}
if (!$this->db->queryF($sql)) {
return false;
}
return true;
}

/**
* Destroy a session
*
* @param string $sess_id
*
* @return bool
**/
function destroy($sess_id)
{
$sql = sprintf("DELETE FROM DB.PREFIX.TABLE WHERE sess_id='".$sess_id."'");
if ( !$result = $this->db->queryF($sql) ) {
return false;
}
return true;
}

/**
* Garbage Collector
*
* @param int $expire Time in seconds until a session expires
* @return bool
**/
function gc($expire)
{
$mintime = time() - intval($expire);
$sql = sprintf('DELETE FROM DB.PREFIX.TABLE WHERE sess_updated < %u', $mintime);
return $this->db->queryF($sql);
}
At this point you should have a working multi-site setup with a shared session and user table. Points of interest I'm looking at is a user interface to add domains replicate domains. I'd love to make this a module format but havent figured out how to get past some of the hacks I've had to do to get this to work smoothly. If it wasnt for the fact XOOPS is so #OOPS#ed extensible I wouldnt have gotten this far.
Any questions comments suggestions or go to hells would be apreciated. err..



4
rts2271
Re: Big dumb question of the week
  • 2005/4/11 16:32

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


Thank you so so so very much. Thats been bugging me for nearly a year but hasnt been a issue I've wanted to tend to until now.



5
rts2271
Big dumb question of the week
  • 2005/4/11 15:52

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


In moving from COBOL and MVS to procedural PHP and now to Object based PHP I have found my code to be a bit bulky. It has gotten much better and now my module project is now pretty close to something I might not be ashamed to let someone else look at.

Theres a particular piece of code related to a MySQL query I am having problems digesting.

$sql = sprintf('UPDATE %s SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', $this->db->prefix('session'), time(), $this->db->quoteString($sess_data), $sess_id);

Im using this as a example case it was on my desktop at the time.

The Dumb question of the day

What do the %s and %u represent, Where are they set or am I looking at this query from too literal a view.



6
rts2271
Re: a final end
  • 2005/4/6 18:55

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


nm i already patched for this lol



7
rts2271
Re: New XOOPS Install ???
  • 2005/3/29 0:36

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


ok I found this that works for all my sites except Xoops. However I think I screwed some permissions up on the pages themselves.
Try the following things
If its a existing install
Update your passwords with
update mysql.user set Password= OLD_PASSWORD('PASSWORD') WHERE User='USER';
If its a new install use
mysqladmin -u root password 'PASSWORD' to initially set the password
Then log into your MySQL as root by
mysql -u root -pPASSWORD
in the MySQL interface issue a
use mysql;
then reset the password to the old system with
update user set Password= OLD_PASSWORD('PASSWORD') WHERE User='root';
then issue a
flush privileges;
then quit the interface
then stop mysql
restart with the following parameter attached to your startup routine.
mysql start --old-passwords
This forces the 4.1 engine to use the older password client libraries.
I dont know if that helps your case or not but it did bring all my sites except my xoosp one back up(again a permissions issue there I think)
**UPDATE**
My issues with XOOPS was a permissions oversight on my part durring the transfer. Indeed the above steps has restored my XOOPS instalation and another buddies whose been going thru this for about a month. For some reason apache for myself and a few others doesnt accept just the OLD_PASSWORD fix that helps a number of other users. You also have to tell the db engine to use the older libraries. Granted your not going anywhere security wise but man I really want insert yadda yadda on duplicate keys lol.
Note I cant wait til mysql5 and we get stored procs.



8
rts2271
Re: New XOOPS Install ???
  • 2005/3/28 23:19

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


It's the new password hash in mysql. It is incompatible witht he client library PHP is currently using. Having same issue myself. Will post a work around if I find it and no the OLD_PASSWORD('PASS') function doesnt work.



9
rts2271
Re: xHLSTATS Module NEEDS UPDATE for Counter-Strike Source
  • 2005/2/26 2:04

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


ok check this out
I have modded HLStats somewhat for CSS.
It records headshots
Tracks via wonid and name at same time while keeping individualized stats

TODO:
Evolve my current cobbled together stats/system/admin management system into a solid one piece module.
Module has a web based banlist which updates the server on the fly.
Module has a admin system which updates the server admins privleges based on levels. It also adds admins to there proper forums and groups when there hired on or promoted demoted or fired.

Adding in connections tracking

Adding in connection time tracking

Adding in the HLS perl modules to run off the XOOPS configuration.

Redesigning a more modular format to make extending the logging functions easier and more standardized.

Removing the entire front end. The idea is that the stats software itself simply pulls the data off the network and dumps it to the DB. Let the designer figure out how he wants it displayed.

Check out my site
www.mercnet.org
check out the stats web based banning system with list, demo uploader/dloader. It's not complete but if theres interest and I had some parties interested in beta'ing it I might be able to coblle together a installer.
Anyways at the very least I have the HLStats current version with a custom upgrade for CSS



10
rts2271
Hi Quick question
  • 2004/5/27 15:36

  • rts2271

  • Just popping in

  • Posts: 10

  • Since: 2004/5/26


I have just moved to the XOOPS framework. I'm quite impressed. I've been developing with the nukes since it was juse nuke and see XOOPS being the api for db intensive work with the upcoming changes in PHP (v5).
Now done with the buttkissing :P
The members online function always shows a 1 to 1 for regusers and anons. Is this normal and if so has anyone tried a patch to remove the anons session once the anon is logged in with any success? Im asking this cause I dont see it in the API docs anywhere and dont want to break something in the API thats going to cause me to pull my hair out 6 months from now lol.
Thanks
RT Smith




TopTop



Login

Who's Online

166 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

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

Latest GitHub Commits