This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Make sure subject exists


avatar
Rushian 0
From: -
Make sure subject exists

How can I make sure the news title exists before posting it?

Yeah, I know I can edit it later, but sometimes I don't notice. Smiling Face

Hopefully a warning message could be displayed and then you'd be returned to the form without losing anything.

Any ideas?

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Make sure subject exists
avatar
OP 0
From: -
Make sure subject exists

Could go right along with the news preview function I'd imagine...
1 Re: Make sure subject exists
avatar
Administrator
1340
From: Vienna, Austria
Make sure subject exists

Not without some larger modifications. I will add a title check in the next major relase.
1 Re: Make sure subject exists
avatar
OP 0
From: -
Make sure subject exists

Ok, that worked. Any way to mod it to warn you BEFORE the item is committed to the database? Smiling Face
1 Re: Make sure subject exists
avatar
Administrator
1340
From: Vienna, Austria
Make sure subject exists

Open cadmin/mod_news in an editor and find in function AddNews():

        MkHeader("_self");

MkTabHeader ("$words[DO]");
echo $words[SA];
MkTabFooter();
MkFooter();

Replace this with:

        MkHeader("_self");

MkTabHeader ("$words[DO]");
echo $words[SA];
if (!$newstitle) echo "<br />Warning: News title is missing in this story";
MkTabFooter();
MkFooter();

This will add a warning in case that the news title is missing. You still need to edit the news under edit/remove.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.