293201
nuffy
Re: Some pointers on how to build a theme
  • 2003/4/24 8:41

  • nuffy

  • Just popping in

  • Posts: 1

  • Since: 2003/4/21


As a newebie to php, mySQL and XOOPS2, I was having a little trouble understanding a few things. BUT, your message was fantastic and a great help to me!

THANK YOU!!!!!!



293202
TitaNs
Re: Database problem
  • 2003/4/23 20:54

  • TitaNs

  • Just popping in

  • Posts: 7

  • Since: 2003/4/11


I have a phpmyadmin control panel in my server(on the internet)
and I still get an error messagge "can not connect to database server"

if I have an username and password for database I dunno what are these and I can not see any database in my PMA control panel(I can log in my PMA control panel)


but in XOOPS I write my username and pass but it still error..



293203
mike-h
Re: remembering logins?
  • 2003/4/23 11:22

  • mike-h

  • Just popping in

  • Posts: 5

  • Since: 2002/8/7 6


what are the chances of this autologin being added to the offical core
Understand concerns, but if offered as a option can only be a good addition ..........maybe?

mike




293204
sylvainb
Re: remembering logins?
  • 2003/4/23 4:59

  • sylvainb

  • Not too shy to talk

  • Posts: 168

  • Since: 2003/2/11


Yes, i know!
I've just experienced it with a patch to include a gallery!



293205
Boobtoob
Re: remembering logins?
  • 2003/4/23 1:33

  • Boobtoob

  • Friend of XOOPS

  • Posts: 202

  • Since: 2001/12/22


just as an fyi, this is a nice hack that works but remember that when you update your XOOPS installation from CVS or fix packs that these files will probably get over written. Keep that in mind and remember to patch any files or you will be pulling your hiar out next time.



293206
sylvainb
Re: remembering logins?
  • 2003/4/22 20:51

  • sylvainb

  • Not too shy to talk

  • Posts: 168

  • Since: 2003/2/11


And voila!
Quote:
File: user.php
==============
After:
------
setcookie($xoopsConfig['session_name'], '', time()- 3600, '/', '', 0); (line +/- 74)
Add:
----
//autologin code//
setcookie ("uid", "", time() - 3600);
setcookie ("pass", "", time() - 3600);
//end autologin code//




File: common.php
================
After:
------
$sess_handler =& xoops_gethandler('session'); (line +/- 127)
Add:
----
//autologin code//
if(empty($HTTP_SESSION_VARS['xoopsUserId']) && !empty($HTTP_COOKIE_VARS['uid']))
{
$passSQL = "select uid from ".$xoopsDB->prefix("users")." where pass = '".$HTTP_COOKIE_VARS['pass']."' and uid = ".$HTTP_COOKIE_VARS['uid'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
if ($passRst['uid'] == $HTTP_COOKIE_VARS['uid'])
{
$HTTP_SESSION_VARS['xoopsUserId'] = $HTTP_COOKIE_VARS['uid'];
$xoopsUser =& $member_handler->getUser($HTTP_SESSION_VARS['xoopsUserId']);
$HTTP_SESSION_VARS['xoopsUserGroups'] = $xoopsUser->getGroups();
}
else
{
setcookie ("session_name", "", time() - 3600);
setcookie ("uid", "", time() - 3600);
setcookie ("pass", "", time() - 3600);
}
}
//end autologin code//
After:
------
setcookie($xoopsConfig['session_name'], session_id(), time()+(60*$xoopsConfig['session_expire']), '/', '', 0); (line +/- 172)
Add:
----
if(!empty($HTTP_COOKIE_VARS['pass']) && !empty($HTTP_COOKIE_VARS['uid'])) // check or cookies already exist
{
// Cookie Set Code for autologon //
$passSQL = "select pass from ".$xoopsDB->prefix("users")." where uid = ".$HTTP_SESSION_VARS['xoopsUserId'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
setcookie('uid',$HTTP_SESSION_VARS['xoopsUserId'],time()+(60*60*24*365), '/', '', 0);
setcookie('pass',$passRst['pass'],time()+(60*60*24*365), '/', '', 0);
// Cookie Set Code for autologon //
}





Template: system_block_login.html
=================================
Add:
----
Remember me?





File: include/checklogin.php
============================
After:
------
setcookie($xoopsConfig['session_name'], session_id(), time()+$xoopsConfig['session_expire'], '/', '', 0);
Add:
----
if($rememberme == "On") // check or user has checked the checkbox, if not do nothing
{
// == Cookie Set Code for AutoLogon == //
$passSQL = "select pass from ".$xoopsDB->prefix("users")." where uid = ".$HTTP_SESSION_VARS['xoopsUserId'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
setcookie('uid',$HTTP_SESSION_VARS['xoopsUserId'],time()+(60*60*24*365), '/', '', 0);
setcookie('pass',$passRst['pass'],time()+(60*60*24*365), '/', '', 0);
// == Cookie Set Code for AutoLogon == //
}

But it's still on koudanshi's site THERE



293207
ndial
Re: Database problem
  • 2003/4/21 20:58

  • ndial

  • Just popping in

  • Posts: 29

  • Since: 2003/3/3 1


The problem with making a detailed non-technical tutorial is, it probably is different for different web hosts. (Unless you have your own co-located server, and if you're paying that much rent you really ought to know what you're doing or hire somebody who does )

If you get a "can't connect to database server" error and you're using settings that your hosting company told you to use to connect, you should probably contact them because it's probably a server problem.

If you get "unable to create table" it just means you don't have the permissions to create a database, and you'll have to either submit a request to your host to get an admin (or admin script) with more rights than you to make one, or you'll just have to add the tables to a database that you already have (which isn't so bad because XOOPS namespaces everything anyway).



293208
jlm69
Re: Database problem
  • 2003/4/21 20:57

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


You most likely have to have your hosting company create the database and they will give you info like :

database host
database username
database password
database name

Then you just fill in the blanks when you start XOOPS setup.



293209
bjmartin
Re: Database problem
  • 2003/4/21 20:08

  • bjmartin

  • Just popping in

  • Posts: 1

  • Since: 2003/4/21


I am relieved to see someone else having the same problem lol, ie; database creation.

I've read the answers, but it still sounds greek to me??
My host provides MySQL (but not the phpmyadmin).

I get the same error message about the inability to locate the database, and am absolutely stumped on creating one.

Any "Detailed" 4th grade tutorial would be very appreciated lol.




293210
ndial
Re: Database problem
  • 2003/4/21 18:53

  • ndial

  • Just popping in

  • Posts: 29

  • Since: 2003/3/3 1


Wait a minute -- you said you had a phpMyAdmin control panel. Do you mean you've got a hosting setup that provides a phpMyAdmin control panel, or just that you've downloaded the files? If you've got a phpMyAdmin control panel from your hosting company, then you've got a database from them, too. You just need to make sure you're using the right username and password, and pointing to the right place.

Or if your host has some special procedure for creating a database, you may have to fill out a form or something. Or, if you're managing your server yourself and you don't have a database server at all, you still have to install MySQL I'd go with the latest production release, though XOOPS will run just fine with 3.23.







Login

Who's Online

310 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 310


more...

Donat-O-Meter

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

Latest GitHub Commits