I'm wanting to make a dropdown menu for images in sections so the adminstrators of sections, may choose from the uploaded images, rather then having to enter the name manually.
I looked in admin/sections.php and I think I have the code to edit, and I think I know what needs to go in there, I'm just not sure of the order of it.
This is the portion of code I believe has to be edited. Starting at line 106
|
Code:
|
OpenTable();
echo "<center><font class=\"option\">"._ADDSECTION."</font></center>
"
."<form action=\"admin.php\" method=\"post\">
"
.""._SECTIONNAME.":
"
."<input type=\"text\" name=\"secname\" size=\"40\" maxlength=\"40\">
"
.""._SECTIONIMG."
<font class=\"tiny\">"._SECIMGEXAMPLE."</font>
"
."<input type=\"text\" name=\"image\" size=\"40\" maxlength=\"50\">
"
."<input type=\"hidden\" name=\"op\" value=\"sectionmake\">"
."<INPUT type=\"submit\" value=\""._ADDSECTIONBUT."\">"
."</form>";
CloseTable(); |
There is another area of similar code starting at line 201.
|
Code:
|
$result = sql_query("select secid, secname, image from ".$prefix."_sections where secid=$secid", $dbi);
list($secid, $secname, $image) = sql_fetch_array($result, $dbi);
$result2 = sql_query("select artid from ".$prefix."_seccont where secid=$secid", $dbi);
$number = sql_num_rows($result2, $dbi);
OpenTable();
echo "<img src=\"images/sections/$image\" border=\"0\" alt=\"\">
"
."<font class=\"option\">"._EDITSECTION.": $secname</font>"
."
("._SECTIONHAS." $number "._ARTICLESATTACH.")"
."
"
."<form action=\"admin.php\" method=\"post\">"
.""._SECTIONNAME."
<font class=\"tiny\">"._40CHARSMAX."</font>
"
."<input type=\"text\" name=\"secname\" size=\"40\" maxlength=\"40\" value=\"$secname\">
"
.""._SECTIONIMG."
<font class=\"tiny\">"._SECIMGEXAMPLE."</font>
"
."<input type=\"text\" name=\"image\" size=\"40\" maxlength=\"50\" value=\"$image\">
"
."<input type=\"hidden\" name=\"secid\" value=\"$secid\">"
."<input type=\"hidden\" name=\"op\" value=\"sectionchange\">"
."<input type=\"submit\" value=\""._SAVECHANGES."\"> [ <a href=\"admin.php?op=sectiondelete&secid=$secid&ok=0\">"._DELETE."</a> ]"
."</form>"; |
This is what I think I need to insert, but I'm not sure where it goes.
|
Code:
|
$result = sql_query("select image from ".$prefix."_sections where secid=$secid", $dbi);
list($image) = sql_fetch_row($result, $dbi);
echo "<table border=\"0\" width=\"70%\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>"
."<table border=\"0\" width=\"100%\" cellpadding=\"8\" cellspacing=\"1\" bgcolor=\"$bgcolor1\"><tr><td>"
."<img src=\"<img src=\"images/sections/$image\" border=\"0\" alt=\"\">"; |
The first portion of code, doesn't have any reference to to the image, but the sql does query the same table, so I'm wondering if adding the image query to the existing one and inserting the table values for the dropdown would be enough there.
Does the code I want to insert look right? Does anyone know where to put it? :?
Thanks for your help