Advertisement:

Author Topic: Song Request PHP Script  (Read 33369 times)

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Song Request PHP Script
« on: May 17, 2008, 01:09:45 PM »
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]
Code: [Select]
"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
« Last Edit: June 01, 2008, 11:20:17 AM by brianjw »

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: PHP Script that lists these values
« Reply #1 on: May 18, 2008, 10:52:15 AM »
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

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: PHP Script that lists these values
« Reply #2 on: May 18, 2008, 11:00:08 AM »
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.

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #3 on: May 18, 2008, 06:11:30 PM »
OK, thanks [SiNaN].

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

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: PHP Script that lists these values
« Reply #4 on: May 18, 2008, 11:11:31 PM »
Maybe, Drop me a PM and we'll see.

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: PHP Script that lists these values
« Reply #5 on: May 25, 2008, 12:09:54 PM »
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

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #6 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. :)

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #7 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).

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. :)

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: PHP Script that lists these values
« Reply #8 on: May 25, 2008, 04:56:59 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

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #9 on: May 25, 2008, 05:48:19 PM »
LOL. :P

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: PHP Script that lists these values
« Reply #10 on: May 26, 2008, 02:41:39 AM »
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

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.

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.

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

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #11 on: May 26, 2008, 02:13:37 PM »
Cool. Thanks. :)

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

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: PHP Script that lists these values
« Reply #12 on: May 27, 2008, 01:43:16 AM »
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

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #13 on: May 27, 2008, 06:20:12 AM »
If you want you could give it to me how it is now and then when you get the time you can update it. :)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: PHP Script that lists these values
« Reply #14 on: June 01, 2008, 10:04:54 AM »
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.
« Last Edit: June 02, 2008, 04:12:22 AM by [SiNaN] »
Former SMF Core Developer | My Mods | SimplePortal

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: PHP Script that lists these values
« Reply #15 on: June 01, 2008, 11:25:43 AM »

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Song Request PHP Script
« Reply #16 on: June 02, 2008, 04:13:42 AM »
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
« Last Edit: June 02, 2008, 04:15:33 AM by [SiNaN] »
Former SMF Core Developer | My Mods | SimplePortal

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: Song Request PHP Script
« Reply #17 on: June 02, 2008, 02:05:50 PM »
Works perfect. :)

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

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Song Request PHP Script
« Reply #18 on: June 02, 2008, 02:07:40 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

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: Song Request PHP Script
« Reply #19 on: June 02, 2008, 02:13:48 PM »
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