Forum Moderators: coopster

Message Too Old, No Replies

I have a Script conflict, one goes blank

I need help.

         

geiri

2:52 am on Apr 18, 2004 (gmt 0)

10+ Year Member



Hi I hope some one can help me in this problem.
I am not a programer and dont know php at all.

I am using two scripts on my site.

"Rose News" and "Article Engine"

Now when I open my site to the news and browse to the Articles and then back. Everthing on the news page is gone. Reloading is not enough.
I have to shut down the browser and open it again in a few minutes. or empty my IE temp files folder.

what is it?

Thank you..
geiri

parasane

8:36 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



Sorry, Geiri, I'm not sure I understand your request fully. Are you clicking the back button in your browser to go back? If so, it's quite possible that the cached file expired when you browsed away, then corrupted when you tried to browse back to it. This may explain why you have to continuously close and re-open your browser.

Try instead to continue in a forward-navigation, and don't click the back button. If that fixes it, cool. If not, or if I'm misunderstanding your question, just post a bit more information or a URL to the problem page.

geiri

10:08 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



Thank you for your reply parasane

I tryied what you said keept browsing around for some time, and then hit the home button and everthing worked fine. :)

The second time it did not work?

Thank you
Geiri

[edited by: jatar_k at 10:50 pm (utc) on April 18, 2004]
[edit reason] no personal urls thanks [/edit]

jatar_k

10:54 pm on Apr 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld geiri,

It is quite strange behaviour. I couldn't read therror message so I am not sure what it said but...

The only thng that comes to mind is are you using sessions or cookies? I can only guess that when you come back to the page some setting is keeping it in the broken state.

Since the only way you can reset it is to kill the browser, that is why sessions came to mind. I can't really think of any other reason.

geiri

1:48 am on Apr 19, 2004 (gmt 0)

10+ Year Member



Thanks for your reply jatar_k

The error message simply says "no news"
Is to be shown if no news are available.

I agree with you both that this has to be a session or a cookie thing.

The thing is I don’t know much about php

So If you guys can help me I would be grateful.

So where do we start ;)
Can I post some code here? or a link to the scripts…
Or is there some code I can use to clear the .....?

Thank you
Geiri

jatar_k

4:08 pm on Apr 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You will have to learn a little now then.

The first thing you need to do is isolate the portion of the code that is giving you that specific "No News" message.

Do you know where it gets the news from? I assume from a database of some kind.

The important information is to figure out what variables are being used to retrieve the news and where they are getting messed up.

Look through the source code and try to isolate this portion of the code, since we don't allow massive code dumps or links to personal sites you will have to do a little leg work. In the end this will help you a lot more than someone just doing it for you.

For now, look for the error message and the database call and post those few lines of code here and we can go from there.

geiri

8:44 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



Ok then, you are brave :)

The news system is called Rose news it was popular around 2002, then it was dropped.

It uses Mysql.
I went to PhpMyAdmyn and checked out the database for the id that calls the nonews error.
this is the layout
Varid is 3
Varname is nonews
Varvalue is No news have been posted

This is the code I found in the news script.


$template = replace_datetime($template, $date, $time_array);
$thenews .= $template;

$merlin_speak .= merlin($merlinstuff, $news_stuff, $date);
}
$i++;
endwhile;
}
if ($thenews == '') {
$thenews = $variable[nonews];
}

if ($merlintalk == 'On') {
$topfile = file("includes/merlintop.inc");
$topfile = implode("", $topfile);
$bottomfile = file("includes/merlinbottom.inc");
$bottomfile = implode("", $bottomfile);
$merlin_to_send_back = $topfile;
$merlin_to_send_back .= $merlin_speak;
$merlin_to_send_back .= $bottomfile;
$merlintalk .= $merlin_to_send_back;
}

else {$merlintalk = '';}

return $thenews;

}

There is also some cookie settings there time
saying controlling if you have read the news or not..

Thank you for your help and time..

Geiri

jatar_k

9:07 pm on Apr 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



guessing....

it looks like the date stuff might be the mess

$thenews is the var being tested and it is based somehow on $date

Where does $date come from? Is that the cookie stuff?

saying controlling if you have read the news or not..

so maybe it lets you see the news once and then assumes you have read it and only shows news that is newer than the cookie date.

can you post the cookie stuff, pls?

geiri

10:10 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



This is the code I was reffering to.


# ok, plant the cookie saying they've read this category
$thenoo = mktime (date(H), date(i), date(s), date(m), date(d), date(Y));
SetCookie ( "con-cat-$category", $thenoo, time()+30412800);
$catinfo = get_cat_array();

Geiri

jatar_k

10:27 pm on Apr 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



then does it reference $_COOKIE somewhere?

geiri

11:06 pm on Apr 20, 2004 (gmt 0)

10+ Year Member



This ....

# now cookies stuff
# find out who's logged in for Admin links
$variable[username] = $HTTP_COOKIE_VARS["con-Username"];
$variable[nickname] = $HTTP_COOKIE_VARS["con-Nickname"];
$variable[loggedin] = $HTTP_COOKIE_VARS["con-Logger"];
$variable[userpassword] = $HTTP_COOKIE_VARS["con-Password"];
$variable[userlevel] = $HTTP_COOKIE_VARS["con-Level"];
}
if ($variable[pagename] == 'None') {
Die;
}
[code]

And this might do somthing ....
[code]
session_start();
if (!$PHPSESSID) {session_register('sess_voice');}
if ($merlin == 'on' ) {$sess_voice = 'On';}
elseif ($merlin == 'off' ) {$sess_voice = 'Off';}
include ('includes/newsfunctions.php');
$the_menu = menulayout($category, $showheadlines);
$the_category_menu = categorymenu('0');

geiri

10:57 pm on Apr 24, 2004 (gmt 0)

10+ Year Member



Fixed :)

jatar_k

2:38 pm on Apr 25, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



nice

what was it geiri?