PDA

View Full Version : Cutenews and AJAX - +REP



Jahova
05-07-2008, 08:51 PM
Here's the thing..
I have been using cutenews with my site for ages. Recently, I have switched from iFrames to AJAX - Javascript.
This is where the problem is, cutenews will no-longer open the full story in the AJAX div, so I am screwed.


I posted a thread in the coding community and Invent replied telling me that I had to change some things in 'shows.inc.php'.
I have tried and failed as I am not the best with PHP and javascript.


I need someone who knows about AJAX and cutenews / php, to maybe write a tutorial for me on how to do it, or.. Do it for me.
Invent wrote the below which is an breif idea on what to do;


Originally posted by Invent;
'To fix that you need to change your shows.inc.php file so that all the links run the javascript function instead of loading a page.
If you can't do this yourself, I'll do it for you when I get a chance'


But Invent hasn't had the time and I am just lost / newbie.


Any help guys?
+REP to all help / answers.


- Tom
Here is the link; http://www.habboxforum.com/showthread.php?t=488123 (http://www.habboxforum.com/showthread.php?t=488123)
And shows.inc.php in a .txt; http://www.spitsworld.com/shows.txt

Protege
05-07-2008, 09:23 PM
Ajax and iframes don't work the same lol, how are you opening the link using ajax?

Jackboy
05-07-2008, 09:55 PM
Try:


$output = str_replace("[link]","<a href=\"$PHP_SELF?subaction=showfull&amp;id=$news_arr[0]&amp;archive=$archive&amp;start_from=$my_start_from&amp;ucat=$ news_arr[6]&amp;$user_query\">", $output);


change that line to this:



$output = str_replace("[link]","<a onclick=\"javascript:ajaxpage('$PHP_SELF?subaction=showfull&amp; id=$news_arr[0]&amp;archive=$archive&amp;start_from=$my_start_from&amp;ucat=$ news_arr[6]&amp;$user_query', 'content');/">", $output);

Source
05-07-2008, 10:11 PM
Slightly off topic I know and sorry for that. But it will help us all in the long run.

PLEASE STOP centering your writing. Just leave it default, I never reply to your posts because it looks like alot of effort to read it. Thats all :)

Independent
05-07-2008, 11:35 PM
Why are you posting in this forum?

Florx
05-07-2008, 11:53 PM
Slightly off topic I know and sorry for that. But it will help us all in the long run.

PLEASE STOP centering your writing. Just leave it default, I never reply to your posts because it looks like alot of effort to read it. Thats all :)
Your opinion. He can do what he wants, the CENTER function is there for a reason...

TO BE USED. I always BOLD my text, so it's easier for me to know when I have posted when I read a thread again.

Protege
05-07-2008, 11:54 PM
I can see where hes coming from, I dont mind the center its just the small font, I have to make it bigger - its hard to read on my screen lols.

Joshuae
06-07-2008, 12:38 AM
Slightly off topic I know and sorry for that. But it will help us all in the long run.

PLEASE STOP centering your writing. Just leave it default, I never reply to your posts because it looks like alot of effort to read it. Thats all :)


:rolleyes: Dude, what's the point?

Jahova
06-07-2008, 08:32 AM
Guys can you please stay on-topic as this thread is for my problem only, discuss your differences outside of this thread.

@ JackBoy - Who is the only one to help ATM.
I have changed it and it shoves an error in my face;
'Parse error: syntax error, unexpected '[' in /home/cowly/public_html/news/inc/shows.inc.php on line 692'

So it seems to have ruined the line below :S

Also, any other forum members willing to help?

Jackboy
06-07-2008, 12:02 PM
Sorry didn't spend enough time doing it properly..

Change that same line to:


$output = str_replace("[link]","<a onclick=javascript:ajaxpage('$PHP_SELF?subaction=s howfull&amp;id=$news_arr[0]&amp;archive=$archive&amp;start_from=$my_start_from&amp;ucat=$ news_arr[6]&amp;$user_query', 'content');>", $output);

Jahova
06-07-2008, 01:00 PM
That opens the news article in a new window.
Any help on how to make it open in the div..?

Independent
06-07-2008, 01:17 PM
That opens the news article in a new window.
Any help on how to make it open in the div..?
All you do is ask for help and critisize other users.
You could give something back.

Jahova
06-07-2008, 01:47 PM
How is that critisizing, I just said it opens it in the new window and not in a div.
Hardly 'critisizing'. And if I had never said it, he wouldn't know that it wasn't working, so sthu idiot and get your definitions right, fool..

Jackboy
06-07-2008, 02:11 PM
chang 'content' to the name of ur div

Jahova
06-07-2008, 02:29 PM
My div is called 'content' and still no luck.
Anychance you could test it yourself to see the problem.
Or anyother members got any ideas.

Thanks for your efforts btw.

Independent
06-07-2008, 03:22 PM
How is that critisizing, I just said it opens it in the new window and not in a div.
Hardly 'critisizing'. And if I had never said it, he wouldn't know that it wasn't working, so sthu idiot and get your definitions right, fool..

In other threads, NOT this.

Bit of a stupid kid?

Jahova
06-07-2008, 04:03 PM
I critisize users because their work is rubbish.
Whats the point of saying 'what a lovely layout', when it's a load of crack.
And I don't give anything back because I have nothing to give back.
-
Anyway, Can you please leave my thread as you are not acheiving somthing and you cannot win as you have got yourself into a mess.
-
Btw, thanks for helping out Jackboy =]
Any other suggestions guys?

Jackboy
06-07-2008, 05:41 PM
gimme url to ur site where u have the news etc pls

Jahova
06-07-2008, 05:45 PM
http://www.cowly.co.uk/news
Is where news is ^

http://www.cowly.co.uk/
Is where layout will be ^

content
Is the name of the div ^

Jackboy
06-07-2008, 06:10 PM
but i wanna see the div in the layout if u get me...

Jahova
06-07-2008, 06:19 PM
No can do atm.
Almost reached upload limit on host.
It's just a page with a div. Not that hard =S

Jackboy
06-07-2008, 06:25 PM
No can do atm.
Almost reached upload limit on host.
It's just a page with a div. Not that hard =S

If its not that hard then do it yourself.

PreProcessor
06-07-2008, 06:30 PM
Well how are people to help you if you don't show what's happening..? Delete stuff off the server then if you are nearly at the max.

Jahova
06-07-2008, 06:59 PM
Jackboy - here..
http://cowly.co.uk/

Want to hide these adverts? Register an account for free!