View Full Version : 1.5beta1 - CATEGORY LINKS FORMAT
Small one:
When you select a new Cathegory links format, the next time you look to the page the menu is back on "Select Category Links Format".
Would be nicer if it stays on your new choice. Like in the "Calender type"-menu.
Posible solution:
admin/options.php, row 410:
<select name='catformat' Onchange=\"if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\" >
";
if($cfgrow['catgluestart'] == ""){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."' >$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom' >custom...</option>
</select>
tinyblob
12-19-2005, 09:59 AM
Thanks,
This is the kind of thing that sits unnoticed for ages :)
Warho
12-30-2005, 04:44 PM
Hi,
The code submitted by eon does not work. The error message is shown at the bottom of Admin page.
Parse error: parse error, unexpected T_IF, expecting ',' or ';' in /<< absolute path >>/admin/options.php on line 410
raminia
12-30-2005, 06:29 PM
add "; after </select>
Warho
12-30-2005, 08:57 PM
That doesn't work either. Still same error message shown.
The code which I have pasted is:
------
<select name='catformat' Onchange="if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\">
if($cfgrow['catgluestart'] == ""){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."' >$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom' >custom...</option>
</select>";
------
I have also tried this one:
------
<select name='catformat' Onchange="if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\" >
";
if($cfgrow['catgluestart'] == ""){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."' >$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom' >custom...</option>
</select>";
------
raminia
12-30-2005, 10:02 PM
ok then don't change it. it's not a big bug and not lethal. live with it
add "; after </select>
Nop, that's not the problem. The echo will be closed, but not here.
@Warho
<select name='catformat' Onchange="if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\">
if($cfgrow['catgluestart'] == ""){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."' >$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom' >custom...</option>
</select>";
Here you forgot a ; in this row:
<select name='catformat' Onchange="if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\">;
if($cfgrow['catgluestart'] == ""){
Thats what your error saying:
"Parse error: parse error, unexpected T_IF, expecting ',' or ';' in /<< absolute path >>/admin/options.php on line 410"
Here you have a "; to much on the last row.
<select name='catformat' Onchange="if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\" >
";
if($cfgrow['catgluestart'] == ""){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."' >$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom' >custom...</option>
</select>";
This is the good code (with little change when the first character is empty):
<form name='catformatform' method='post' action='$PHP_SELF?view=options&optaction=updatecat format' accept-charset='UTF-8' >
$admin_lang_optn_cat_link_format_txt<br />
<select name='catformat' Onchange=\"if (this.selectedIndex=='6') {flip('costumcatformat')};return false;\" >
";
if(empty($cfgrow['catgluestart']) && empty($cfgrow['catglueend'])){
$catglue = "Select Category Links Format";
} else {
$catglue = $cfgrow['catgluestart'] . "category-1" . $cfgrow['catglueend']." ".$cfgrow['catgluestart']. "category-2" . $cfgrow['catglueend']." ".$cfgrow['catgluestart'] . "etc" . $cfgrow['catglueend'];
}
echo "
<option value='".$cfgrow['catgluestart']."'>$catglue</option>
<option value='['>[category-1] [category-2] [etc]</option>
<option value=' ,'>category-1, category-2, etc</option>
<option value=' -'>category-1 - category-2 - etc</option>
<option value=' |'>category-1 | category-2 | etc</option>
<option value=' /'>category-1 / category-2 / etc</option>
<option name='customname' value='custom'>custom...</option>
</select>
<div id='costumcatformat'>
<p />
Costum category format <br />
Starting string: <input type='text' name='startcatformat' class='input' size='3' value='[' />
Ending string: <input type='text' name='endcatformat' size='3' value='] ' />
</div>
<script type='text/javascript'>flip('costumcatformat');</script>
<input type='submit' value='$admin_lang_optn_update' />
</form>
</div>
<div class='jcaption'>
$admin_lang_optn_calendar_type
</div>
<div class='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updatecal endar' accept-charset='UTF-8'>
<select name='cal'>
";
Do you see the last row? There is the echo ending. :D
raminia
01-02-2006, 08:06 AM
good job
Connie
01-08-2006, 01:50 PM
is this fixed in CVS already?
se.nsuo.us
01-08-2006, 02:00 PM
For stuff like above the heredoc notation should be used the <<<EOT stuff
For stuff like above the heredoc notation should be used the <<<EOT stuff
:o I don't understand you. The part "the heredoc notation" and "the <<<EOT stuff".
That's not your problem but can you still explain this to me?
Connie
01-08-2006, 06:09 PM
eon,,
that is a form of notating textoutput in PHP without defining every line by "echo ..." and without the need to mask all quotes etc.
a very comfortable way to define textoutput, because everything between
<<<EOTand EOT will be echoed as pure text, EOT stands as a marker, you could even define like this example :rolleyes:
echo <<<EON
<html>
<head><title>Something for Joey</title></head>
<body>
<h1>Hi Joey, Hello World!</h1>
</body>
</html>
EON
I am sure this example has some syntax-errors but just to show!
PS: I thought Joey had this question, but it is you, eon,
so I modified the example!
Joey,
that is a form of notating textoutput in PHP without defining every line by "echo ..." and without the need to mask all quotes etc.
a very comfortable way to define textoutput, because everything between
<<<EOTand EOT will be echoed as pure text, EOT stands as a marker, you could even define like this example :rolleyes:
echo <<<JOEY
<html>
<head><title>Something for Joey</title></head>
<body>
<h1>Hi Joey, Hello World!</h1>
</body>
</html>
JOEY
I am sure this example has some syntax-errors but just to show!
Aahhh, cool. I didn't know that. It is also more readable for a developer. :D
Thanks for your explanation!
Joe[y]
01-08-2006, 06:40 PM
hehe. that's useful for me too connie!
']hehe. that's useful for me too connie!
Since I'm on this forum I learn a lot about PHP, webarchitecture and more.
se.nsuo.us
03-16-2006, 04:44 AM
Code eon has posted will work better if instead of testing if($cfgrow['catgluestart'] == ""){ we tested if($cfgrow['catglueend'] == ""){
Fixed on CVS.
Topic closed.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.