61
phillipd
Re: My own module
  • 2005/1/13 21:26

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Is there a way to avoid this security issue, in a secure manner, of not allowing a insert,update,delete from a GET? I need to possibly do a insert when a user hits a page depending on if something exists in the DB. How would I do this?

Thanks

Doug P



62
phillipd
xoops_session table has 272 thousand rows
  • 2004/12/12 19:36

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I have a public XOOPS LUG site. I was backing it up with mysqldump when I discovered there were about 272,000 rows in the xoops_session table. Is this normal? Do these sessions ever get cleaned out??? Can I clean them out? Are they used for tracking users on polls or anything like that?

Thanks

Doug P



63
phillipd
Re: What determines the vertical ordering of the "Admin" icons
  • 2004/12/7 23:25

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I tried the suggestion in the FAQ:

https://xoops.org/modules/smartfaq/faq.php?faqid=278

But the system admin Icon never returns to the top. It bounces between 2nd, third and forth.

Doug P



64
phillipd
What determines the vertical ordering of the "Admin" icons
  • 2004/12/7 22:04

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I logged on to my XOOPS 2.0.7 site today and went to the Administration menu to find the admin Icons in a different order. Normally the "System Admin" Icon is at the top. It now appears as the forth from the top. I can't see a mechanism to alter this configuration. I looked in the xoops_modules table and its mid is 1 and it's weight is 0. I thought the weight only affected the order a module appears in the "Main Menu". What might be the cause of this? How do I return it to normal?

Thanks

Doug P



65
phillipd
$xoopsDB->query() doesn't work for "alter table ... drop column ..."
  • 2004/12/7 7:28

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I use $xoopsDB->query() for SELECT, UPDATE, INSERT and adding columns and it works fine. But I tried to delete a column with:

$rec = "ALTER TABLE ".$xoopsDB->prefix('inventory')." DROP COLUMN ".$colname."";

$xoopsDB->query($rec);

And it doesn't work. Any ideas? queryF works ok...

I know the drop syntax is correct because I echo $rec and paste it to mysql's command line interface and it works fine.

Also, after noting the following from the mysqldatabase.php file, how do ANY queries work?

/**
* perform a query
*
* This method is empty and does nothing! It should therefore only be
* used if nothing is exactly what you want done!
*
* @param string $sql a valid MySQL query
* @param int $limit number of records to return
* @param int $start offset of first record to return
*
* @abstract
*/
function &query($sql, $limit=0, $start=0)
{

}

How is it my other queries even work??? What's up with this? What am I missing?

Regards

Doug P



66
phillipd
Re: Smarty in a function
  • 2004/12/2 7:41

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Oh shoot. It works but there are no graphics. I then try to include the "header.php" for the graphics but get the error:

Fatal error: Call to a member function on a non-object in /var/www/html/xoops/html/header.php on line 138

Which appears to be template related.

Here is code:

function showinv() {
    global 
$xoopsDB,$xoopsConfig;
    
$xoopsOption['template_main'] = 'user.html';
    require_once 
XOOPS_ROOT_PATH.'/header.php';
    require_once 
XOOPS_ROOT_PATH.'/class/template.php';
    include_once 
XOOPS_ROOT_PATH.'/class/xoopsformloader.php';

    
$xoopsTpl = new XoopsTpl();

//   more smarty assigns and appends
}


Doug P



67
phillipd
Re: Smarty in a function
  • 2004/12/2 7:20

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


OH! Thanks, it's almost working now... Thats 4 or 5 times you have really helped me. Will you marry me? (Kidding...)

Doug P



68
phillipd
Re: Smarty in a function
  • 2004/12/2 6:00

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Thats not working. Has anyone got a working example of smarty in a function? What do you need to "include" or "require" to get it working?

I seem to be in "dependency hell" here. Every time I fix a "Call to a member function on a non-object", I get another...


Thanks

Doug P



69
phillipd
Smarty in a function
  • 2004/12/2 4:17

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I've got smarty in admin scripts working, but using smarty in a function is still a problem. I think it requires:

function whatever() {
    global 
$xoopsDB;
    require_once 
SMARTY_DIR.'Smarty.class.php';
    
$xoopsTpl = new Smarty;
    include_once 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";
    
$form = new XoopsThemeForm("""userform""index.php");

    
$form->assign($xoopsTpl);
}

just like an admin script, but when doing the:

$xoopsTpl->display('db:'.$xoopsOption['template_main']);

I get an obscure error:

Fatal errorCall to undefined function: xoops_canupdatefromfile() in /var/www/html/xoops/html/class/smarty/plugins/resource.db.php on line 16

Nothing gets displayed...
Any idea what I'm missing???

Thanks

Doug P



70
phillipd
How do you get the "String" name of the DB in a module?
  • 2004/11/27 23:11

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I need to use the mysql_list_fields() method to get the tables in my DB. This function requires the name of the db. What api call does XOOPS provide for this? Or is there another way to get it?

Nevermind, I Found it... XOOPS_DB_NAME

Thanks

Doug P




TopTop
« 1 ... 4 5 6 (7) 8 9 10 ... 22 »



Login

Who's Online

251 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 251


more...

Donat-O-Meter

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

Latest GitHub Commits