61
Brad
Re: more advanced analyses of traffic
  • 2004/3/19 15:04

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


If I recall correctly (which is a challenge, considering I can barely remember yesterday), I didn't display the stats on my site at all. I didn't have it operational long enough to get out of my testing phase, I was that disappointed in it.



62
Brad
Re: more advanced analyses of traffic
  • 2004/3/19 14:20

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


I have to throw in my 2 cents as well...

I used Power Phlogger (pphlogger) briefly but immediately noticed that it slowed down my site. I then changed to Php-Stats and was more than pleasantly surprised.



63
Brad
Re: What would you recommend is the best galary module?
  • 2004/3/19 13:46

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


It's probably going to take me a bit while longer but I am currently working on a port of the latest release of the Coppermine Photo Gallery that I'm dubbing xCMGallery. Not only will it be the latest release, but it'll also include the ability to have other media files in addition to pictures such as MPG's and WMV's. When I'm done with it, it should use your existing theme, as much as possible, like all good modules should.

I'm also attempting to keep exact track of all the changes I am making and plan on providing those (search and replace statements) as well as a listing of all the files added or deleted from the core Coppermine install. In theory, that means one could update to a newer version of Coppermine in the future with minor modifications of the "script" without waiting for someone else to get off their ass and do it for them.

Don't hold your breath waiting for this port however. I have a 5-month old baby girl who requires a lot of attention.

Brad



64
Brad
Re: Delete query fails in Xoops, succeeds in phpMyAdmin
  • 2004/3/16 21:33

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


Thank you. And again, thank you for your help. Thank you to skalpa as well. And finally, thanks again to Dave.

Stay tuned... I'm sure I'll have other questions as I get into this some more.



65
Brad
Re: Delete query fails in Xoops, succeeds in phpMyAdmin
  • 2004/3/16 21:29

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


OK... I'm starting to pick up what you guys are laying down.

In the case of the code I had originally presented, I would then need to make the indicated changes:

$core_table $xoopsDB->prefix('groups');
$mod_table  $xoopsDB->prefix('xcmg_usergroups');

// Build comma-delimited list of group PK's that are in core groups table.

[color=FF0000]$core_groupsids "";[/color]

$sql "SELECT groupid FROM $core_table WHERE 1";
$result $xoopsDB->query($sql);

while (
$row $xoopsDB->fetchArray($result))
{
    
$core_groupids .= $row['groupid'] . ",";
}
$core_groupids substr($core_groupids0, -1);
$xoopsDB->freeRecordSet($result);

// Delete module groups that do not exist in the core groups table.

$sql "DELETE FROM $mod_table WHERE group_id NOT IN ($core_groupids)";
[
color=FF0000][d]$result $xoopsDB->query($sql);[/d]
$result $xoopsDB->queryF($sql);[/color]

I assume that I wouldn't have to worry about variable validity since I am the one creating all the variables used. I further assume that queryF would be the best option because I'm just performing internal housekeeping, not performing a request by the user and thus is that much less likely to get hijacked.

Brad



66
Brad
Re: Delete query fails in Xoops, succeeds in phpMyAdmin
  • 2004/3/16 17:53

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


Mith -

The following code is how I get the group IDs:

$core_table $xoopsDB->prefix('groups');
$mod_table  $xoopsDB->prefix('xcmg_usergroups');

// Build comma-delimited list of group PK's that are in core groups table.

$sql "SELECT groupid FROM $core_table WHERE 1";
$result $xoopsDB->query($sql);
while (
$row $xoopsDB->fetchArray($result))
{
    
$core_groupids .= $row['groupid'] . ",";
}
$core_groupids substr($core_groupids0, -1);
$xoopsDB->freeRecordSet($result);

// Delete module groups that do not exist in the core groups table.

$sql "DELETE FROM $mod_table WHERE group_id NOT IN ($core_groupids)";
$result $xoopsDB->query($sql);

Pardon me for being dense on this subject but...

(1) How would I use a POST method for accomplishing what I'm attempting to do?

(2) What, regarding security, should I be looking at if I decide to use db::queryF instead? As this code is not using any outside variables, is it safe?

(3) I assume using a POST method and db::query is the preferred way of executing a delete query, correct?

Thanks for your help Mith!

It's only a matter of time before I get my head fully around PHP and Xoops. Between the help you and Dave are giving me, I hope to get there sooner than later.

Brad



67
Brad
Delete query fails in Xoops, succeeds in phpMyAdmin
  • 2004/3/16 17:14

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


DELETE FROM xoops_xcmg_usergroups WHERE group_id NOT IN (1,2,3,4)

The preceding query works flawlessly when issued through phpMyAdmin but when it gets executed by Xoops, it always fails. Anyone have any ideas on why this might be?

I have noticed that no where else in the XOOPS core code are there deletes with the NOT IN clause. Perhaps I should take that as a hint that they won't work?

What I'm trying to do is synchronize a module's groups table with XOOPS core groups table. The NOT IN clause is listing all the group ids from the XOOPS core groups table.

Brad



68
Brad
Re: Difference between methods of SQL queries
  • 2004/3/15 17:47

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


$xoopsDB->query("DELETE FROM $table WHERE id = [color=FF0000]'$id'[/color]");

Which leads me to another question (I'm relatively new to the PHP world), do you need the apostrophes around $id? It seems like I've seen the same type of query with and others without the apostrophes.



69
Brad
Difference between methods of SQL queries
  • 2004/3/15 16:55

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


I noticed that XOOPS 2.0.6 prefers coding SQL queries with the sprintf function as follows:

$sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("partners"), $id);

Prior to 2.0.6 I believe XOOPS would have coded it as follows:

$sql = "DELETE FROM ".$xoopsDB->prefix("partners")." WHERE id = $id";

Why the difference? Is there a benefit to using the new method?

Brad



70
Brad
Re: can i re-create webmaster use with uid=1?
  • 2004/3/15 16:33

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


All I can say is, wow.

That is a really bad programming practice to make assumptions about a particular key existing in a table that the module developer has no control over.

I'm further mystified as to why the module only allows the one person to make administrative changes rather than the entire adminstrative group or barring that, having a config option that indicates who is able to administrate.

Again, wow.

Glad you got it working though.

Brad




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



Login

Who's Online

210 user(s) are online (137 user(s) are browsing Support Forums)


Members: 0


Guests: 210


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