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

Misc Questions


avatar
kdobson99 0
From: -
Misc Questions

LOVE the product. Now have the full version. Going to have several Misc. small issues as I get it configured correctly for my purposes. I will try to keep them all in a single thread. Here are the first two:

1. I want to add a field to the "Submit News" template. Obviously I know how to edit the template and add a field. My question is... how do I get it to post it in the correct field when I review it in the Queue? Essentially, I have created an extra field in my news db for "URL" where I post the URL for external news items. It is Field 1. Once someone posts something to the submit news page and puts a URL in the form field I create, how do I get it to post it to the "Field 1" space when I review the queue?

2. In my "Add News" I also want to create a dropdown list for an extra field. I see where I can choose to make a field a dropdown list rather than a text box. But I don't know how to populate the options of the dropdown list.

Thanks... there will be more questions, I'm sure.

Notice

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

Responses to this topic


1 Re: Misc Questions
avatar
Administrator
1340
From: Vienna, Austria
Misc Questions

Regarding the extra field... I didn't modify any files. I just added the extra field in the Edit Fields section, then added the string for that field in the "add story" template section. (which I know modifies the news.tmp file, but Im working within the admin panel.) Didn't touch submitstory.php. The extra field appears at the bottom of the "submit story" form.

Extra fields are not supported in the submit story form. However, a field could be added be added with a few modifications in submitstory.php and mod_news.php.

First, you need to add an extra field to the table esselbach_st_storyqueue. This could be done by running the following SQL query in phpMyAdmin

ALTER TABLE  esselbach_st_storyqueue ADD  storyq_extra1 VARCHAR(80) NOT NULL;


Then open submitstory.php in an editor and replace:

    if (phpversion() >= "4.1.0")

{
$author = $_POST["author"];
$subject = $_POST["subject"];
$story = $_POST["story"];
$email = $_POST["email"];
}

$author = checkvar($author);
$subject = checkvar($subject);
$story = checkvar($story);
$email = checkvar($email);

with:

    if (phpversion() >= "4.1.0")

{
$author = $_POST["author"];
$subject = $_POST["subject"];
$story = $_POST["story"];
$email = $_POST["email"];
$extra1 = $_POST["extra1"];
}

$author = checkvar($author);
$subject = checkvar($subject);
$story = checkvar($story);
$email = checkvar($email);
$extra1 = checkvar($extra1);

Replace:

        DBQuery("INSERT INTO esselbach_st_storyqueue VALUES (NULL, '$website', '$author', '$email', '$ipaddr', '$subject', '$story', now())");

with:

        DBQuery("INSERT INTO esselbach_st_storyqueue VALUES (NULL, '$website', '$author', '$email', '$ipaddr', '$subject', '$story', now()), '$extra1'");


Save the script and open cdmin/mod_news.php. In function AdminNewsQueue change the following part:

echo "</td><td></td><td><font face="Arial" size="2"><input name="extra$i" size="32"></font></td></tr>";

to:

if ($i == 1)

{
echo "</td><td></td><td><font face="Arial" size="2"><input name="extra1" size="32" value="$story[storyq_extra1]"></font></td></tr>";
}
else
{
echo "</td><td></td><td><font face="Arial" size="2"><input name="extra$i" size="32"></font></td></tr>";
}


If I was wanting to create a simple page that had all of the look of the frontpage of my Esselbach site in a separate directory... meaning the header, and right and left columns are the same, and the links in those columns work.. and only wanted to change what appears in the "center" of the page.... what files would I need to move to that directory besides the sitewide templates? Or, am I getting over my head?

I am not familiar with that script but have it a section where you can add your own header/footer?
1 Re: Misc Questions
avatar
OP 0
From: -
Misc Questions

Also, might as well ask question 3 now...

I want to use another script unrelated that is a php script and runs in a separate directory. I really want that program to fit within the general template of the Esselbach program. It is essentially a directory script (Dew-NewPHPLinks) . I'm going to get confused here... but lets start simple....

If I was wanting to create a simple page that had all of the look of the frontpage of my Esselbach site in a separate directory... meaning the header, and right and left columns are the same, and the links in those columns work.. and only wanted to change what appears in the "center" of the page.... what files would I need to move to that directory besides the sitewide templates? Or, am I getting over my head?
1 Re: Misc Questions
avatar
OP 0
From: -
Misc Questions

Can I just add the following to the submit news template?

<input name="extra1" size="32">

and it will know where to post it.. just lke it does for <input name="email" ?
1 Re: Misc Questions
avatar
OP 0
From: -
Misc Questions

Regarding the extra field... I didn't modify any files. I just added the extra field in the Edit Fields section, then added the string for that field in the "add story" template section. (which I know modifies the news.tmp file, but Im working within the admin panel.) Didn't touch submitstory.php. The extra field appears at the bottom of the "submit story" form.
1 Re: Misc Questions
avatar
Administrator
1340
From: Vienna, Austria
Misc Questions

1. I want to add a field to the "Submit News" template. Obviously I know how to edit the template and add a field. My question is... how do I get it to post it in the correct field when I review it in the Queue? Essentially, I have created an extra field in my news db for "URL" where I post the URL for external news items. It is Field 1. Once someone posts something to the submit news page and puts a URL in the form field I create, how do I get it to post it to the "Field 1" space when I review the queue?

Did you already modified submitstory.php to allow the extra field? This requires a few modifications in mod_news.php as well.

2. In my "Add News" I also want to create a dropdown list for an extra field. I see where I can choose to make a field a dropdown list rather than a text box. But I don't know how to populate the options of the dropdown list.

The syntax is: Fieldname,Option1,Option2

This would create a dropdown box named "Fieldname" with the options Option1 and Option2

Notice

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