291241
Draven
Re: 3rd party chat advice needed
  • 2003/10/9 16:10

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


Well did you enclose the function in tags? If not, that would explain why the code is being printed to the screen. The exact file lloks like this.

Quote:
function b_inchat_show() {
global $xoopsDB,$xoopsUser;

$block = array();

$result = $xoopsDB->query("SELECT c.name AS name, d.uid AS uid FROM chat_users c, ".$xoopsDB->prefix("users")." d WHERE NOW( ) - datetime < 12 AND d.uname LIKE c.name");


while ( $myrow = $xoopsDB->fetchArray($result) ) {
$block['users'][] = $myrow;
}
$block["count"] = count($block['users']);
return $block;
}

?>



As for the template, did you create the inchat.html file in flashchat/templates/blocks folder? it needs to be there. Usually when it shows up under system->templates and doesn't generate, it's because the file is missing but says it's not in the xoops_version.php. Make sure you have it named correctly both the file name itself and the
Quote:
$modversion['blocks'][1]['template'] = 'inchat.html';

is correct also.



291242
lykoszine
Re: PHP Help
  • 2003/10/9 15:51

  • lykoszine

  • Module Developer

  • Posts: 244

  • Since: 2002/1/2 2


Not a hundred percent sure howto get the address/path of the file off by heart, should be easy to find at php.net though

You cannot == strings, you need to use strcmp or something. (look that up also...)

How's that for some unhelpful help?



291243
abdala
PHP Help
  • 2003/10/9 15:36

  • abdala

  • Just popping in

  • Posts: 42

  • Since: 2003/2/5 1


Hi,

Quick PHP question if that's allowed:

I want to write the following in PHP but I don't know how since I don't know much PHP at all. In a table cell, I wanna do the following:

if ((address in address bar)==("string1")){
echo "string2";
}

How would I code this in PHP?

Thanks,
Abdala



291244
kjs222
Re: image manager category gone ?
  • 2003/10/9 14:53

  • kjs222

  • Friend of XOOPS

  • Posts: 116

  • Since: 2003/3/1 1


I'M AFRAID TO UPGRADE!
I appreciate the advice, and I know the IDEAL is to update; however, the site in question is HIGHLY modified (almost every template, language files, and some php files)... Soo..... I'm hesitant to perform the upgrade.

BUT...
I believe you're suggesting that there's a related file (most likely the imagecategory class file?) that is causing the problem:

- Would I be foolish to update related files file but NOT upgrade?
- Are my upgrade fears completely unfounded?

Thanks,
Keith



291245
gstarrett
Re: image manager category gone ?
  • 2003/10/9 14:44

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:

kjs222 wrote:
So... trying to follow thread of people smarter than me...

I did:

1. download cvs file: main.php

1.b. install that over my old main.php (xoops 2[snip]


You should really update all your site at once unless you really understand there are no dependencies between the file you're updating and others. Try an update to XOOPS 2.0.5, it seems quite stable. As a general rule, backup your site first as a reasonable precaution.



291246
leather
Re: Business Directory Created
  • 2003/10/9 14:37

  • leather

  • Just popping in

  • Posts: 1

  • Since: 2003/10/5


Looks Great. I am real new to Xoops, so bear with me. I had planed to go in an opposite direction and hack off "MyAds" Mod because the fields/categories are totally generic. This would be a "Members Recommend" and vote giving 1 to 5 stars recommendation.

I thought, you being in such a localized market in Folsom, that you might be interested in the voting aspect to increase your membership participation in your site. And this would give you additional local merchants to approach for your Highlighted listings.

If you’re interested in how the Star rating calculation works let me know.

Ron





291247
DobePhat
Re: 3rd party chat advice needed
  • 2003/10/9 14:30

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Draven,
First of all thanks for this!

I have a problem though, I cant seem to recognizeinchat.html as a template?! It shows up but when I try to generate it (in template admin) it says it does not exist.

when I choose to display block (at least it gives me that option too!) it displays the php script above the header...
Im a little confused...did I did something wrong?

I updated the module and everything.hmmmmm
cache maybe?
I dunno...any advice is much appreciated. Thanks a lot this is great.

__OH I just checked it out...PHP Block (mine) is incorrect...I just pu in your function into a blank file and named it inchat.php...but perhaps you didn't mean to use that code only, am I missing something?>



291248
tl
Re: BUG - retrieving password
  • 2003/10/9 14:12

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Thank you, now it works.
tl



291249
mercibe
LDAP authentication
  • 2003/10/9 13:37

  • mercibe

  • Just popping in

  • Posts: 55

  • Since: 2003/6/12


It is my first PHP "development" and first post to a public forum. So I am a bit shy... Time to share experience!
I have just finished the first version of a small hack to use our internal user directory accessible through LDAP for XOOPS user authentication.
The goal is to allow all users registered in the Directory to directly connect to Xoops, without having to register manually
BUT WITHOUT preventing users not present in the central Directory to register. How is it working ?
In fact, I simply automatically register the users that I can authenticate through LDAP and then let the normal authentication process continue.

2 files have to be modified:


Add these 3 lines at the very beginning of the &loginUser($uname, $pwd) function in /kernel/member.php
$ldap_criteria = new CriteriaCompo(new Criteria('uname'$uname));
        
$ldap_criteria->add(new Criteria('pass'$pwd));        
    
$authenticated $this->_uHandler->LDAPAuthentication($ldap_criteriafalse);


Add the following function to the XoopsUserHandler class in /kernel/user.php
/**
     * retrieve users from a Directory server through LDAP
     * @param object $criteria {@link CriteriaElement} conditions to be met
     * @return true if the user has been authenticated, otherwise false 

     */
    
function LDAPAuthentication($criteria null)
    {           
    
$uid_attr "uid";
    
$mail_attr "mail";
    
$name_attr "cn";
    
$ldap_server "ldap.bb.cc.dd";
    
$ldap_port 389;
    
$base_dn "ou=People,o=bb.cc.dd";
    
$timezone_offset 1;
    
    
$authenticated false;
    
      if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) {
        
    
$ds=ldap_connect($ldap_server$ldap_port) or die("Could not connect to LDAP server.");
                   
    if(
$ds) {
        
          
//Authentication
      
$pass=$criteria->criteriaElements[1]->value;                $ldapbind=ldap_bind($ds,$uid_attr."=".$criteria->criteriaElements[0]->value.",".$base_dn,$criteria->criteriaElements[1]->value);
      if(
$ldapbind) {
                
$authenticated true;
                
// Get info from LDAP (mail,name)
$sr=ldap_search($ds,$base_dn,$uid_attr."=".$criteria->criteriaElements[0]->value,Array($mail_attr,$name_attr)); 
                
$info ldap_get_entries($ds$sr);
        if(
$info["count"] == 1) {
            
// Search user in the DB        
            
$criteria = new CriteriaCompo(new Criteria('uname',$criteria->criteriaElements[0]->value));            
            
$user =& $this->getObjects($criteriafalse);

            
$member_handler =& xoops_gethandler('member');
            

            if (!
$user || count($user) != 1) {
                
$xuser =& $member_handler->createUser();
                
$xuser->setVar("uname",$criteria->criteriaElements[0]->value);
                
$xuser->setVar("user_avatar","blank.gif");
                
$xuser->setVar('user_regdate'time());
                
$xuser->setVar('timezone_offset'$timezone_offset);
                
$xuser->setVar('actkey',substr(md5(uniqid(mt_rand(), 1)), 08));                                
            }
            else {
                
$xuser = & $user[0];
            }    
                        
            
$xuser->setVar("email",$info[0][$mail_attr][0]);
            
$xuser->setVar("name",$info[0][$name_attr][0]);            
            
$xuser->setVar("pass",md5($pass));            
            
$xuser->setVar("level",1);            
            
$xuser->setVar('notify_method'2);
                                                                                                                                    
                    
// Store info in DB (update or insert)
            
$ret $this->insert($xuser);
            
            
//Add the user to Registered Users group
            
$member_handler->addUserToGroup(XOOPS_GROUP_USERS$xuser->getVar('uid'));                    
        }
      }
            
      
ldap_close($ds);
    }
    else {
        
//echo "cannot connect to ldap server";
    
}
        
      }
     
       return 
$authenticated;
  }

In order to minimize the files to modify I put all configuration data directly where there are used.
I suppose it should be located outside, but where ? (config.inc.php ?)
This hack should also work for those working with Active Directory (through LDAP, of course)
by simply adapting LDAP server info at the beginning of the LDAPAuthentication function.

Even if your LDAP server is down, registered users should be able to connect to Xoops.

I hope this will be useful for someone. In our case it allowed us to immediately adopt XOOPS for our internal developper portal.

Now I have to try the secure (SSL login page ?) authentication process to
avoid the "travelling" of clear passwords over the network... Any ideas or tips ?

Regards,

BM



291250
Draven
Re: Banner Management?
  • 2003/10/9 13:32

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


TO be honest I've haven't tried the client login in a long time. In the older versions you would login at the same place as the admin. You can checkout http://phpadsnew.com for more info on the software. They have a good support forum.







Login

Who's Online

187 user(s) are online (164 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

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

Latest GitHub Commits