Addon Release: FakeSQL Version 3.3

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Addon Release: FakeSQL Version 3.3

Postby bozoka45 » Wed Dec 01, 2004 11:34 pm

Another version of this very simple SQL addon.

Improvements:

-Newsitems are now updated on a submited, modified, or deleted basis. Before, the SQL database was rebuilt each time. This should improve speed greatly.
-SQL database is no longer purged. You can now use columns within the same table without worrying about them being affected.

Download Here
Last edited by bozoka45 on Tue Aug 16, 2005 6:41 pm, edited 1 time in total.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby bozoka45 » Fri Dec 03, 2004 6:52 am

I have updated FakeSQL. There was a small bug which prevented some newsfields from being updated in the SQL database, so please upgrade from Version 3.

Download Place is the same.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby bozoka45 » Thu Dec 16, 2004 5:50 am

I just fixed a pretty big bug in FakeSQL and am re-releasing it as version 3.4. The problem was that the SQL database was not sorted when transferring from SQL to the newsdat.txt. This caused newsitems to be sorted in an incorrect manner in both the Modify News screen and the building process.

The download link is the same.

If someone could add this to the Addons Page here at CTUS, that would be great. This version appears to be bug-free.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

FSQL/ClickCount SQL/PHP

Postby dweiss » Thu Dec 23, 2004 2:37 pm

FakeSQL
ClickCount SQL/PHP


Can I use both add-on without problem?

TNX
Regards,
Marry Chistmass
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Postby bozoka45 » Thu Dec 23, 2004 6:13 pm

You should be able to. Clickcount was one of my first addons and its not written in Perl, although it should be. Go ahead and give it a try. You'll probalby have to add a column manually to your SQL database, though.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby dweiss » Mon Feb 07, 2005 11:15 pm

HI!, I have some problems with FSQL.
I have Modified a news item with Coranto Modify Option. I've changed a CustomField that is a CheckBox.
But when I submit the modified news it saves OK in newsdat.txt but not in the MySQL Database ...

Any suggestion?

Regards,
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Postby bozoka45 » Tue Feb 08, 2005 1:03 am

Did you uncheck a checked checkbox?
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby dweiss » Fri Feb 11, 2005 6:43 pm

bozoka45 wrote:Did you uncheck a checked checkbox?


That's right ...

I've uncheck it using Coranto ...

TNX
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Postby bozoka45 » Mon Feb 21, 2005 7:32 am

Sorry for the late reply. I'll have to look into this, as I'm pretty sure I know whats causing the bug, I just need to figure out how to fix it.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby dweiss » Mon Mar 28, 2005 10:26 pm

bozoka45 wrote:Sorry for the late reply. I'll have to look into this, as I'm pretty sure I know whats causing the bug, I just need to figure out how to fix it.


Bazooka, I know it's a minor bug, but I love this add-on, as I know a little PHP programing and none Perl.

But, if you can, and if you have the time, tell us when you get the new version!

TNX,
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Postby bozoka45 » Tue Mar 29, 2005 7:11 am

Around line 177, search for:

Code: Select all
   foreach my $i(@field) {
      $escaped = $dbh->quote(${$i}); #Escape Characters
      if($escaped ne NULL) {
         $values .= "`" . $i . "` = " . $escaped . ", ";
         
      }
   }


Change it to:

Code: Select all
   foreach my $i(@field) {
      $escaped = $dbh->quote(${$i}); #Escape Characters
      if($escaped ne NULL) {
         $values .= "`" . $i . "` = " . $escaped . ", ";
         
      } elsif ($fieldDB{$i}->{'FieldType'} == 4) {
            $values .= "`" . $i . "` = '', ";
      }
   }


Basically, if the field is NULL, IE, there's nothing there, then it doesn't put it in the SQL statement. It saves a little speed. Well, if its a checkbox, then its kinda important if its unchecked or not, so thats what the elsif statement is for.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby dweiss » Thu Mar 31, 2005 11:56 am

bozoka45 wrote:
Code: Select all
   foreach my $i(@field) {
      $escaped = $dbh->quote(${$i}); #Escape Characters
      if($escaped ne NULL) {
         $values .= "`" . $i . "` = " . $escaped . ", ";
         
      } elsif ($fieldDB{$i}->{'FieldType'} == 4) {
            $values .= "`" . $i . "` = '', ";
      }
   }


Basically, if the field is NULL, IE, there's nothing there, then it doesn't put it in the SQL statement. It saves a little speed. Well, if its a checkbox, then its kinda important if its unchecked or not, so thats what the elsif statement is for.


Thanks!!! ...
Regards,
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Subject

Postby dweiss » Sat Jul 09, 2005 8:19 pm

Bozoka45, please, can I sugest an update to the add-on?

I have some problems when the Title (Subject) of the news I've post at Coranto has quotes ("). The title it's cut at de quotes.

In PHP it seems that if you add the addslashes() function it would be solved, and then, when you want to use the data, you shoud add the stripslashes() function.

But in Perl, I don't know how nor where to correct it.

Thanks, and sorry to bother ...

Regards,
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Postby bozoka45 » Sun Jul 10, 2005 3:12 am

This is a quick, untested fix that should work (let me know, please).

Around lind 152, find:

Code: Select all
$escaped = $dbh->quote(${$i});


After that, add:

Code: Select all
$escaped =~ s/\"/\\\"/;


Basically, that should find all double quotes and replace it with \", basically what add slashes does.

BTW, if you're doing an SQL query with PHP and use addslashes(), you don't need to use stripslashes() when using the data, the slashes are "removed" when inserted into the database.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby dweiss » Sun Jul 10, 2005 10:02 pm

bozoka45 wrote:This is a quick, untested fix that should work (let me know, please).

Around lind 152, find:

Code: Select all
$escaped = $dbh->quote(${$i});


After that, add:

Code: Select all
$escaped =~ s/"/\\"/;


Basically, that should find all double quotes and replace it with ", basically what add slashes does.

BTW, if you're doing an SQL query with PHP and use addslashes(), you don't need to use stripslashes() when using the data, the slashes are "removed" when inserted into the database.


Thanks!, I'll try it and later let you know ...

Edit:

Arround line 176 there's another line with

Code: Select all
$escaped = $dbh->quote(${$i});


and I also added this:

Code: Select all
$escaped =~ s/"/\\"/;


Edit later:

Ok, thanks!, works great! ... write down this for any later version ... BTW, any Idea how to work with the new version of NewsCategory addon?

Regards,
Daniel,
Regards,
Saludos,
Daniel,
dweiss
 
Posts: 82
Joined: Mon Feb 02, 2004 2:21 pm
Location: Buenos Aires - Argentina

Next

Return to Addon Release and Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron