Log in

View Full Version : Dropdown menu w/ desc in php-nuke and SQL



Destro
11-02-2009, 04:32 PM
hi there
i hope you guys can help me
because you are my last hope

before i start i must explain
i got a php-nuke site
on this site got a drop-down block with links to several radiostations (CDC_Radio-block if you know it)
when i select one of those stations i get a content under the dropdownmenu

after three years, i collect more then two stations
in other words, currently there are 30 stations with over 70 links

the block i use is "hard code"
so i must edit this thing everytime i want to change something
and you can imagine, it's not funny anymore
i uplodet the block so you can see what i mean.
http://www.destros-world.de/files/block-CDC_radio.txt

so, i decide to recode this block so that i can use it with the SQL DB and the admin menu from nuke

work great, i can set categories, pages (on top and on button) and the pages are shown right in the cat's

my problem is that the content is not shown right (btw. sry for the bad english)

as an example
i got three categories with different pages

"startpage"
cat 1
-page 6
-page 8
cat 2
-page 3
-page 5
cat 3
other pages

my problem is, when i click on page 6, i get the content of page 1
when i click on page 8, i get the content of page 2
and so on

i really don't know any further
and because u got this code on your page too
http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm
you eventually know why :confused:

here is the current code of the block
http://www.destros-world.de/files/block-Contentblock.txt

Destro
11-05-2009, 04:14 PM
no one any idea
it would be really great when i would get a solution for this :(

(sry for push)

james438
11-16-2009, 05:51 AM
It is not terribly likely that you will get a response here in the MySQL section. From what I can tell it is the least visited forum in this message board. I am not really sure why. My guess is that MySQL is frustrating for a lot of people.

Your english is pretty good by the way. It is better than many others where English is their first language. I blame instant messenger first for the degradation of proper grammar.

php-nuke is not really my forte (forte = area of expertise). You might have better luck asking for help in the PHP (http://www.dynamicdrive.com/forums/forumdisplay.php?f=11) forum or Dynamic Drive scripts help (http://www.dynamicdrive.com/forums/forumdisplay.php?f=2) sections.

I know you need a bit of help, but that is a lot of code to read through and I am not very sure what you are asking for. Is there a page that you have that I can look at so I can see your code in action? Can you give an example of what a very simple, yet ideal version of what your page would look like in HTML/CSS format? What the visitor would see in other words. To do this you can write a sample file with only a few results and post the demo page and then we can move from there. Could you also post what the format is of your tables? What the columns are of each table.

If I write a response it will most likely be in some sort of PHP/MySQL format, because that is what I know.

Destro
11-16-2009, 02:13 PM
well, i posted this because i thought it was a php/sql problem
but i found it out, in the original code, the "assignment" of the $pid and $text works with the java (ore what this code should be) code below

to get this work with sql i must set it specially
from this
onChange=\"displaycontent(document.form1.select1.selectedIndex)
to this
onChange=\"displaycontent(document.form1.select1.options[form1.select1.selectedIndex].value)

now the content shows right to the $pid

but now i got an other problem

when i write a text
i must write it without "line breaks"
i don't mean <br>
i mean "enter"

in other words, i must write the code i one line
by the way
i got this problem also at the original block

otherwise the complete block disapears

in an other forum one user tell me i should try <<endofhtml
but i hear that code the first time
and don't really know what i should do with this

you can see the block in action on my page
it is called web radio block (ore that one with the alien)
but that is not the one with SQL

james438
11-17-2009, 03:44 AM
My best suggestion for you is to repost your question in either the javascript forum or the php forum. You are asking about languages and situations that I am not familiar with. Normally you are not supposed to double post, but if anyone complains just tell them I suggested it. I doubt anyone will be upset though.

I didn't want you to think that I was ignoring you. I just can't help you here except to recommend where you can get better help.

Destro
11-27-2009, 05:54 PM
so, finally
i got it, and the next time i ask the right people first :D

don't work:

$content .= "showcontent[$pid]='$text'\n";

work:

$content .= "showcontent[$pid]=\"" .str_replace('"', '\'', str_replace("\n", "", str_replace("\r", "", ($text)))) ."\";\n";