Song Request PHP Script

Started by brianjw, May 17, 2008, 01:09:45 PM

Previous topic - Next topic

brianjw

The song request php script for SMF (as a mod) is below, created by [SiNaN]

I would like a php script that would have a form like this:
Quote
Request a Song
Song Title: _____________________
Song Artist: ____________________
[REQUEST SONG]
"Song Title:" would be normal text.
"___" would be a form text box.
"Song Artist:" would be normal text.
"[REQUEST SONG]" would be a form submit button.


When submitted, it would add it to a table. Let's call the table "smf_djrequest" and would appear on a page that everyone can see about the requests that are in the "que". On that php page that lists the requests in the que, a membergroup id and the admins can access a check mark button which means that that submission has been completed and it will be deleted out of the table.

I also would like captcha field to be on the song request and only allow submissions from the same IP every 20 seconds. In the form, I would also like the person who submitted the form's IP address to be added to the table but only viewable to the membergroup id and the admins on the que page.

I will need help coding the form, creating the table (i suck at mysql), and coding it with another php script I have.

Thanks,
brianjw

[SiNaN]

This is a complete mod request Brian. :D

I'll try to make it if my time permits.

I hate updating mods, but coding new ones are really exciting.
Former SMF Core Developer | My Mods | SimplePortal

Dragooon

Brian, If you use TP 1, I've made a TP Forms module which might do what you want and its currently under Private testing.

brianjw

OK, thanks [SiNaN].

Dragooon, I would like to see the script. Could it be modified to do exactly what I want like above?

Dragooon


[SiNaN]

Is this want you are looking for Brian?

Click for full view


Click for full view


Coded just for practice.
Former SMF Core Developer | My Mods | SimplePortal

brianjw

Sinan, that is exactly what I want! :) Except the ip would obviously only be able to staff but everything else is great. :)

brianjw

Couple of things...

1.) After submit, could it display a message like "Thank you for submitting a request. The DJ's will play this song when it comes at the top of the list. To view the list of songs that have been requeted, click here." (links to List)

2.) Could the time display it exactly how the date appears on posts which is like Today at 04:27:46 PM or on another date then today or yesterday it would appear as May 18, 2008, 11:11:31 PM (with time).

3.) Could the SMF captcha system be added to the request form and possibly make a limit in the admin panel (if there is an admin for this) about how many times they can post in X seconds or something similar to the smf search function. <--To protect from spam....

Thanks so much. :)

karlbenson

Quote from: brianjw on May 25, 2008, 04:51:08 PM
about how many times they can post in X seconds or something similar to the smf search function. <--To protect from spam....

Don't forget the block on Never Gonna Give You Up to prevent from en-masse Rick-Rolling :P

brianjw


[SiNaN]

Quote from: brianjw on May 25, 2008, 04:27:46 PM
Sinan, that is exactly what I want! :) Except the ip would obviously only be able to staff but everything else is great. :)

I am the admin in that site. :D

Quote from: brianjw on May 25, 2008, 04:51:08 PM
1.) After submit, could it display a message like "Thank you for submitting a request. The DJ's will play this song when it comes at the top of the list. To view the list of songs that have been requeted, click here." (links to List)

Will do, not so hard.

Quote from: brianjw on May 25, 2008, 04:51:08 PM
2.) Could the time display it exactly how the date appears on posts which is like Today at 04:27:46 PM or on another date then today or yesterday it would appear as May 18, 2008, 11:11:31 PM (with time).

It is like that. But the time format in that site was like in the screen shot. It will shown as you want in your site.

Quote from: brianjw on May 25, 2008, 04:51:08 PM
3.) Could the SMF captcha system be added to the request form and possibly make a limit in the admin panel (if there is an admin for this) about how many times they can post in X seconds or something similar to the smf search function. <--To protect from spam....

Captcha is easy. I will also try limiting number of request in a definite time.

It has still some work to do.
Former SMF Core Developer | My Mods | SimplePortal

brianjw

Cool. Thanks. :)

If you could get it to me by June 1st that would be terrific! :)

[SiNaN]

Will try but do not think so as my finals are coming and I have tons of projects -related to school- to finish until the end of finals.
Former SMF Core Developer | My Mods | SimplePortal

brianjw

If you want you could give it to me how it is now and then when you get the time you can update it. :)

[SiNaN]

#14
Okay, we are here again with our beta.

Here are the features:
- A menu button works with view music playlist permission
- A list, listing 20 music requests per page
- List can be sorted according to:
  - Song Title
  - Song Artist
  - Member
  - Time
  - State
- Just the users who have moderate playlist permission can see IPs
- A permission for removing own request
- A permission for removing any request
- A permission for changing the status of request
- Users who have moderate playlist permission can do everything
- A page for request which need visual verification (Captcha)

Maybe I've missed some of them.

And lastly this is package.

Test it please. ;)

Note: Brian, can you rename the topic so that it can be more descriptive.
Former SMF Core Developer | My Mods | SimplePortal

brianjw


[SiNaN]

#16
A typo caused the mod not to work in some servers. I have fixed and replaced the package. It's attached on the post above.

Here is a demo: http://www.bizmuhacirler.com/demo/index.php?action=playlist
Former SMF Core Developer | My Mods | SimplePortal

brianjw

Works perfect. :)

Quote from: brianjw on May 25, 2008, 04:51:08 PM
Couple of things...

1.) After submit, could it display a message like "Thank you for submitting a request. The DJ's will play this song when it comes at the top of the list. To view the list of songs that have been requeted, click here." (links to List)

2.) Could the time display it exactly how the date appears on posts which is like Today at 04:27:46 PM or on another date then today or yesterday it would appear as May 18, 2008, 11:11:31 PM (with time).

You replied to these two and said that you would do it and that the time limit displays like it does set on your site, but it is set as something like "Today at 04:13:42 AM" but it shows as "June 02, 2008"

Thanks,
brianjw

[SiNaN]

Quote from: brianjw on June 02, 2008, 02:05:50 PM
Works perfect. :)

You replied to these two and said that you would do it and that the time limit displays like it does set on your site, but it is set as something like "Today at 04:13:42 AM" but it shows as "June 02, 2008"

Thanks,
brianjw

Is the first one that much important?

Time format is the same as the format of overall forum. If you want to change it, tell how you want it to appear.

Any other comments on it?
Former SMF Core Developer | My Mods | SimplePortal

brianjw

Well the first isn't really important at all, it's just a preference.

The time format is [I just checked in the admin] set to display as "today ....." but it displays in the playlist as "june 02, 2008"

Thanks,
brianjw

Advertisement: