Contentteller

Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >

Error when trying to replace string

Discussion in 'Version 1.x' started by jfranco, Jul 6, 2008.

  1. jfranco Guest

    Error when trying to replace string

    I recently tried to replace "bigbox" string for "erabigbox" in all of my reviews using the built-in search & replace feature but was welcome by the following message:

    Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JavaScript' type='text/javascript'>

    Is this something you have fixed on newer versions of the CMS, and/or is there a workaround for this if I want to make this replacement?

    Thanks

    Julio
    jfranco, Jul 6, 2008
    #1
  2. Philipp Guest

    Error when trying to replace string

    This problem is in the latest version as well :(. I guess a new maintenance release of Storyteller CMS is now overdue.

    The fix is easy. Open cadmin/mod_reviews.php in an editor and replace:

    Code:
    DBQuery("UPDATE esselbach_st_review SET $search_field = '$out_field', review_editip = '$ipaddr' WHERE review_id = '$rows[review_id]'");
    with:

    Code:
    DBQuery("UPDATE esselbach_st_review SET $search_field = '".addslashes($out_field)."', review_editip = '$ipaddr' WHERE review_id = '$rows[review_id]'");
    Philipp, Jul 6, 2008
    #2
  3. jfranco Guest

    Error when trying to replace string

    For a second I really sweat it...

    Unfortunately I tried this on a live environment and it caused all review pages to be overwritten by the first page content. Furthermore, it removed all special code like links, images, etc... it was all converted to plain text.

    Thank god for backups!

    BTW, check out TechSpot's new redesign: http://www.techspot.com

    You may want to update the examples page here in Esselbach.

    Thanks

    Julio
    jfranco, Jul 7, 2008
    #3
  4. iampedro Guest

    Error when trying to replace string

    Is this whole site based upon Storyteller CMS besides the forum?
    iampedro, Jul 7, 2008
    #4
  5. Philipp Guest

    Error when trying to replace string

    BTW, check out TechSpot's new redesign: http://www.techspot.com
    Looks great :). Don't forget to re-add the powered by notice.
    Philipp, Jul 7, 2008
    #5
  6. Philipp Guest

    Error when trying to replace string

    Your site is still violating the license agreement. You need to either restore the “Powered by” notice or buying the branding free option.
    Philipp, Jul 13, 2008
    #6
  7. jfranco Guest

    Error when trying to replace string

    Hey, just checked this thread... I will add the notice now. With all the changes and stuff going on I didn't remember about that.

    However, you probably missed on my previous response that the code you provided to fix the search and replace feature actually messed up my whole database. I had to restore from a backup.
    jfranco, Jul 15, 2008
    #7
  8. jfranco Guest

    Error when trying to replace string

    Bumping this thread just so you know I have added back StoryTeller to our footer (which was unintentionally missed), and to confirm that the code above does not fix the search & replace functionality in cadmin/mod_reviews.php.

    Thanks

    Julio
    jfranco, Jul 24, 2008
    #8
  9. Philipp Guest

    Error when trying to replace string

    I have added back StoryTeller to our footer (which was unintentionally missed)
    Thanks Julio. I had in the past bad experience with a few customers who removed the notice. I am always enforcing this part of the license agreement after there are also customers who have paid for the removal.

    confirm that the code above does not fix the search & replace functionality in cadmin/mod_reviews.php
    I see what the problem is. Some variables have already escaped quotes ($zid, $extra1) and some are not ($rows[$search_field])

    The following change should fix this problem:

    Code:
    $out_field = str_replace(stripslashes($zid), stripslashes($extra1), $rows[$search_field]);
    Philipp, Jul 25, 2008
    #9
Tweet
Facebook:
Forgot your password?
Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >
  • Home
  • Forums

    Forums

    Quick Links
    • Search Forums
    • What's New?
  • Members

    Members

    Quick Links
    • Registered Members
    • Current Visitors
    • Recent Activity
  • Help

    Help

    Quick Links
    • Smilies
    • BB Codes
    • Trophies

Separate names with a comma.

Advanced search...
    Forum software by XenForo™ ©2011 XenForo Ltd.