WordPress.org

Ready to get started?Download WordPress

Forums

gb url-checker not working (18 posts)

  1. renet
    Member
    Posted 6 years ago #

    hi!

    for this plugin (http://wordpress.org/extend/plugins/dmsguestbook/) the url-checker is not working. no matter what url i type in, it says "not a valid url". i found the following code that might be the cause of this problem:
    preg_match ("/^(http(s)?:\/\/|www\.)+([a-z0-9-]+)*\.([a-z]{2,4})$/i", $_REQUEST[gburl])

    what's wrong here?

    btw: this plugin is programmed in a horrible way. -.-

  2. DanielSchurter
    Member
    Posted 6 years ago #

    ("/^(http(s)?:\/\/|www\.)+([a-z0-9-]+)*\.([a-z]{2,4})$/i", $_REQUEST[gburl])

    This code is valid for URL like:
    http://url.tld
    https://url.tld
    http://www.url.tld
    https://www.url.tld
    http://www.url.tld

    This was tested by my self.
    URL check like url.tld will be probably implementation in the next major release.

    btw: this plugin is programmed in a horrible way. -.-
    this was a sunday project, i need a guestbook for wordpress and i dont found any. The code will also rewrite in the next version.

    Thank you for feedback!
    Daniel Schurter, Switzerland

  3. renet
    Member
    Posted 6 years ago #

    thanks for your reply.

    what about adding an url like:

    http://www.url.de.vu

    or

    subdomain.hoster.com

    or

    http://www.webspaceprovider.com/users/username/home.html

    ?

    would you add a possibility to disable the url-checker? =)
    thanks a lot.

  4. DanielSchurter
    Member
    Posted 6 years ago #

    This problem is solved.
    Now DMSGuestbook check correct the url format:

    http://www.url.de.vu
    subdomain.hoster.com
    http://www.webspaceprovider.com/users/username/home.html

    And with parameters:
    http://www.webspaceprovider.com/users/username/home.php?test=1

    Daniel Schurter

  5. weingartens
    Member
    Posted 6 years ago #

    Greetings -

    I'm using DMSGuestbook v.1.3.0 and believe that I'm experiencing the same problem. I've setup permalinks in this manner: "/%category%/%postname%/". I have setup the plugin successfully and it appears on the page as desired,... but upon attempting to post it redirects to: "/index.php?page_id=40" (the ID is correct) and the page is blank.

    I've been programming for 10+ but am a WordPress newbie and am not understanding this thread. You state that the issue is solved, but I don't follow. Would you be so kind as to elaborate with specifics?

    This is a great plugin and look forward to implementing on my site. Thanks in advance for your understanding and assistance.

  6. DanielSchurter
    Member
    Posted 6 years ago #

    This thread describe the problem when your input an url in your guestbook form. (valid check)
    Some kind of url was not valid in a first version of guestbook and always the message appears "Invalid url adress!" when users type any url in the guestbook url input form.

    Have you seen this hint?
    Can be helpfull
    http://codex.wordpress.org/Using_Permalinks

    Daniel

  7. weingartens
    Member
    Posted 6 years ago #

    Thank you very much for your reply. I believe that I understand permalinks, but it would appear that the guestbook is not behaving properly within my structure.

    Could you give it a look? It's at http://newsworthiest.com

    You'll see that the guestbook appears fine, but upon attempting to post it redirects incorrectly.

    Many thanks!

  8. DanielSchurter
    Member
    Posted 6 years ago #

    1.) Check your rewrite rules in your .httacces

    Otherwise, quick and dirty :-)
    2.) Replace this code:

    <form action="<?=$url;?>/index.php?page_id=<?=$gb_page_id;?>" method="post">

    in dmsguestbook.php, line 456 with this one:

    <form action="<?=$url;?>/40/" method="post">

    40 ist your guestbook id

    Daniel Schurter

  9. weingartens
    Member
    Posted 6 years ago #

    Thank you so much for your assistance! I actually had to use the following:

    456:<form action="<?=$url;?>/guestbook/" method="post">

    ...but it works great now!

    Thanks again!
    Martin

  10. weingartens
    Member
    Posted 6 years ago #

    FYI - Also had to edit lines 296, 299, 311 and 317 to correct the navigation.

    from:
    href='$url/index.php?page_id=$gb_page_id&from=$x&select=$y'
    to:
    href='$url/guestbook/?from=$x&select=$y'

  11. DanielSchurter
    Member
    Posted 6 years ago #

    yes, i had forgotten this. :-)
    Daniel

  12. weingartens
    Member
    Posted 6 years ago #

    Thanks Daniel -

    Is it possible to change the the chronological ordering of the guestbook entries? For example, as it is now:

    (1) Last Guest Entry
    (2) First Guest Entry

    Would like:

    (2) Last Guest Entry
    (1) First Guest Entry

  13. DanielSchurter
    Member
    Posted 6 years ago #

    Replace DESC to ASC in the dmsguestbook.php file on the line 283

    Daniel

  14. weingartens
    Member
    Posted 6 years ago #

    Sorry, I should have been more specific... I'm hoping to edit the ($_REQUEST[itemnr]) item found on line 375. I believe I understand that you programmed it as a list item, but I am trying to brand the first post with (1) second post with (2) etc., regardless of ASC or DESC.

    i.e.:
    DESC
    (3) Third Post
    (2) Second Post
    (1) First Post

    ASC
    (1) First Post
    (2) Second Post
    (3) Third Post

    It's no big deal if it's a problem, I can just eliminate the ($_REQUEST[itemnr]) tag altogether if necessary.

  15. DanielSchurter
    Member
    Posted 6 years ago #

    Ok i understand you.
    Replace $_REQUEST[itemnr] with $dbresult->id

    This is the database id for every post, when you delete a post, like 23, the number 23 will never you see again.

    Daniel

  16. weingartens
    Member
    Posted 6 years ago #

    Daniel -

    I think that I finally have it setup the way I want it. I sincerely appreciate your patience and understanding while working through this. You've programmed a cool little plugin and I envy you your talent and skills. I wish we lived closer together so I could buy you a beer and pick your brain.

    If you have no objection, I'd like to edit your guestbook entry (thanks btw) to add a link to your plugin. If you don't mind, please leave a URL to the page of your desire. Also, do you have an English version of your site?

    Thanks again!

  17. DanielSchurter
    Member
    Posted 6 years ago #

    Hi, thanks for you post and suggestions.
    I saw you modified guestbook with the highlighted form fields, nice idea! This could be an option in a next version of DMSGuestbook.

    My homepage is only available in german, because my english is not so fine :-)

    Cheers with a virtual beer! *klack*

  18. weingartens
    Member
    Posted 6 years ago #

    Thanks for reminding me,... I had forgotten to stylize my input fields... I added this inline CSS to make the background color change:
    style="background-color:#EEEEEE;" onblur="this.style.backgroundColor='#EEEEEE';" onfocus="this.style.backgroundColor='#FFFFFF';"

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic