[geeklog-devel] Pop-up topic listing code...

Tony Bibbs tony at tonybibbs.com
Thu Feb 6 14:05:02 EST 2003

Hrm, it really does look good!


On Thu, 6 Feb 2003, Rob Griffiths wrote:

> For the longest time, I've been conserving veritcal real estate with a
> horizontal topic bar in lieu of the section block ... but I got tired of
> it, and decided to create a pop-up topic list for inclusion in the side
> panel. You can see the results (on a somewhat irregular basis as the
> machine comes and goes from the net) at http://griffman.homeip.net:5080
> (login guest, pword guestuser). The code uses one line of Javascript to
> execute on selection instead of waiting for the submit button to be
> pressed (though that's present as well, just in case).
> I added the following very simple function to lib-custom.php:
> function phpblock_showtopics($topic='') {
>   global $_CONF, $topic;
>   $retval = '<div align="center"><br>';
>   $retval .= '<form action="index.php" method="get">';
>   $retval .= "<select name=\"topic\"
> onchange=\"window.location=('/index.php?topic='+this.options[this.select
> edIndex].value)\">";
>   $retval .= "<option value=\"\">-- All Topics --</option>";
>   $retval .= COM_topicList('tid,topic',$topic);
>   $retval .= '</select> <input type="submit"
> value="Go!"></form></div>';
>   return $retval;
> }
> Then add a new PHP block with phpblock_showtopics as its name, and
> you're done. Seems to work pretty well, though I think I need to add the
> site URL variable instead of hard coding the /index just in case (but it
> was a rush job last night).
> -rob.
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel

Tony Bibbs         | "I guess you have to remember that those who don't |   
tony at tonybibbs.com | hunt or fish often see those of us who do as       |
                   | harmlessly strange and sort of amusing. When you   | 
                   | think about it, that might be a fair assessment."  | 
                   | --Unknown                                          |

More information about the geeklog-devel mailing list