Jump to content
simpilot

EVENTBooking BETA 1.3

Recommended Posts

I have had this issue for a long time now and never figured it out. If I use a carriage return I get this \r\n in my news posts if I post event as news. at times I do get \r\n\r\n\r\n

Do I need to use something like

$buffer = str_replace(array("\r", "\n"), '', $buffer);

or something like

preg_replace( "/\r|\n/", "", $yourString );

Now I make that sound good but in all actuality, I do not know how or where to either of those two options. I read it on stackoverflow and cant make heads or tails of it.

And notice in my screenshot it is adding a slash in the word chicago\'s? I take it I am going to need to use strip slashes as well? Ironically enough, I was able to post a link to a phony website Ray.com It didn't destroy that at all oddly enough. (the Link is not in this attached screenshot. This shot is from a previous news post)

The admin panel and the actual event page works flawless, it is only if I post event as news.

I appreciate any help I can get.

Ray

post-308-0-94765200-1477610658_thumb.png

Edited by TAV1702

Share this post


Link to post
Share on other sites

I've seen this before when you use multiple lines when posting news, etc.

So fi you say:

Grand Opening

Tuesday...

It will go into the database like Grand Opening r/n/r/n/Tuesday...

I fixed the issue by replacing the textareas with WYSIWYG editors, have you used these while posting?

In the template file, it will look like this (ish)

<textarea name="content" id="editor" style="width: 90%; height:350px;"></textarea>

If it does, then I'm unsure

Share this post


Link to post
Share on other sites

I used a WYSIWYG once in the Forum that Simpilot released but it had a loop hole in it (not the forum but the WYSIWYG I used) and I have been afraid to try one since. If you know of a decent one I can try, I'm all ears. :)

Here is one text area in my files

<tr>
		    <td>New Event Description</td>
		    <td><textarea name="description" rows="4" cols="40"><?php
						    if(isset($event))
						    {echo $event['description'];}
					   ?></textarea></td>
	    </tr>

And here is the other.

<tr>
		    <td>Event Description</td>
		    <td><textarea name="description" rows="4" cols="40"><?php echo $event->description; ?></textarea></td>
	    </tr>

Share this post


Link to post
Share on other sites

Well, I went with the phpVMS WYSIWYG and I still got this on a test post.

\r\n Look ma! Its another test!

\r\n

I'm scratching my head now. I look in the database and the post is clean. It is just fine.

Share this post


Link to post
Share on other sites

As I said before, I'm unsure now. But I do know that it is probably the <br> tag that is causing the issue.

Try this in your output template

<?php
$buffer = str_replace('\r\n', '<br>', $buffer);
echo $buffer;
?>

Or you could use the trim() function

<?php
$buffer = trim($buffer);
echo $buffer;
?>

And see if that works.

As for the Chicago\'s, the data is probably using the DB::escape method so yeah, it'd be stripping slashes

/**
* Format a mySQL string correctly for safe mySQL insert
* (no matter if magic quotes are on or not)
*
* @param string $str String to escape
* @return string Returns the escaped string
*
*/
public function escape($str)
{
return mysql_real_escape_string(stripslashes($str), $this->dbh);
}

Edited by web541
  • Like 1

Share this post


Link to post
Share on other sites

Thanks web I'll give that a try and see how it goes. I actually went and discabled the news function in the events module just because for now. Most likely tomorrow I will uncomment and try your code. I really do appreciate the info.

Share this post


Link to post
Share on other sites

Not saving my event. When i click on save event after entering all of the information it does not save it and does not show up. Please help??

EDIT: FIXED JUST HAD TO RELOAD THE SQL FILES

Thanks,

Trey

 

Edited by treygeboy
Update

Share this post


Link to post
Share on other sites

To set up an event you do not NEED to have anything set up yet. But eventually you will need a departure airport, an arrival airport and at least one active schedule (with a flight number) so your pilots can fly the event on your scheduled date and time.

Edited by ProAvia
clarification

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×