Forum Moderators: coopster

Message Too Old, No Replies

Recognize and put all links below in a drop down

         

xnukerx

8:22 am on Jul 8, 2010 (gmt 0)

10+ Year Member



Hi,

I have a forum when members posting a lot of images links. I would like to organize the page but I don't really know how since I'm lack the knowledge of php :| .

Here it how it's look like now:

IS:
http://img78.imageshack.us/img78/3997/123.jpg
http://img78.imageshack.us/img78/3997/12345.jpg

TP:
http://i42.tinypic.com/123.png
http://i42.tinypic.com/123.png

and so on with a lot of images hosting and links.

I would like to recognize "IS:" "TP:" and receive every links below them and put them in drop down menu, so it's look like that:
[IS] [TP]
or vertical
[IS]

[TP]

and when you click on one of them, it's look like that:
Clicked on IS:
[IS] [TP]
http://img78.imageshack.us/img78/3997/123.jpg
http://img78.imageshack.us/img78/3997/12345.jpg

or vertical. Clicked on TP:

[IS]

[TP]
http://i42.tinypic.com/123.png
http://i42.tinypic.com/123.png

I would be very very thankful for your help

Sherif

12:49 pm on Jul 8, 2010 (gmt 0)

10+ Year Member



Hey xnukerx,

I'm not sure what you mean, or want, but when you are working with PHP, you usually work with a databse such as MySQL to organize and display dynamic content.

In your case, you should have a mysql table for example

with the following structure:


picid | user_id | pic_url | pic_server | pic_category



Then when you do your query, you can arrange the table for example when using MySQl, using the order by command ex:

 SELECT * FROM TableName ORDER BY `pic_server` 


Here you can use the user_id as a reference key for the relational table with the users table, where you can further develop the code to display the username of the person who attached the link.

You can then display the output using something like JQuery to hide the contents and then display it based on the different events that you want.


Sincerely,
Sherif

xnukerx

4:41 pm on Jul 8, 2010 (gmt 0)

10+ Year Member



Hi Sherigf,

I'm looking for a script that scan for imageshack.us or tinypic.com urls and put the sets of links in a clickable drop down box.

Thank you for reply.
I found preg_match function but I don't know how to implement it to my concept :(