Remove http:// from event weblink – error occurring

Home Forums Calendar Products Events Calendar PRO Remove http:// from event weblink – error occurring

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #80450
    jussibr
    Participant

    Hi there,
    Barry recently helped with this issue but the topic has been closed so posting it again here. See link for original thread.
    https://tri.be/support/forums/topic/remove-http-from-event-weblink/#post-75172

    I used the script in my functions file and it seemed to work well, however I am finding that in some event pages it returns an error…

    Warning: strpos() [function.strpos]: Offset not contained in string in /home/…/public_html/…/wp-content/themes/…/functions.php on line 108

    the line on 108 is:
    $inner_ends = strpos($link, ‘<', $inner_starts);

    I am not sure how to fix, or what is wrong exactly. Hoping you can shed some light on it for me.

    Thank you.

    #80461
    Barry
    Member

    Hi jussibr,

    That function certainly isn’t bulletproof – but can you give an example of a link (or single event page) where it fails? Even if you’ve temporarily removed it, that may give a little insight into what’s going wrong.

    Is it failing, for instance, on pages where there is no website link?

    #80720
    jussibr
    Participant

    HI Barry – here is an example: http://www.childslife.ca/event/dickwitformayor-cat-holiday-show/

    Thanks!

    #80800
    Barry
    Member

    Ah ok, yeah the previous snippet assumed you would have populated those fields. As a sidenote, turning off the display of errors is a great idea on a live or production site – even though the ‘problem’ would still be present it would fail silently and, in this case, pretty safely.

    With that said, you could use this version of the snippet instead. Hopefully that will clear this up for you and provide a better means of dealing with empty fields: of course, please do tweak to better fit your needs if it still doesn’t quite hit the mark.

    Thanks!

    #91073
    Barry
    Member

    It’s been a while so I’ll go ahead and close this thread. Of course if you need further help for this or any other issue please do feel free to create a new thread or threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Remove http:// from event weblink – error occurring’ is closed to new replies.