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:
QuoteRequest 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
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.
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.
OK, thanks [SiNaN].
Dragooon, I would like to see the script. Could it be modified to do exactly what I want like above?
Maybe, Drop me a PM and we'll see.
Is this want you are looking for Brian?
Click for full view (http://img138.imageshack.us/img138/4592/playlist1xj6.png)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg138.imageshack.us%2Fimg138%2F4592%2Fplaylist1xj6.png&hash=823b0496f1a6a24f572a0c75ff79b605807fc407)
Click for full view (http://img220.imageshack.us/img220/7735/playlist2ul8.png)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg220.imageshack.us%2Fimg220%2F7735%2Fplaylist2ul8.png&hash=fd26a459591b051ca75c818cd5c043da4b2157bc)
Coded just for practice.
Sinan, that is exactly what I want! :) Except the ip would obviously only be able to staff but everything else is great. :)
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. :)
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
LOL. :P
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.
Cool. Thanks. :)
If you could get it to me by June 1st that would be terrific! :)
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.
If you want you could give it to me how it is now and then when you get the time you can update it. :)
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.
I get an internal server error: http://www.gamerzgarage.com/index.php/action,playlist.html
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
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
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?
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
Quote from: brianjw 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
Okay, anyway, I'll add that preference.
Ahh, yes, that was just a correction. But I think we doesn't need it here at all.
PlayList.php
Find and Delete:
// Finally, create a date string so we don't overload them with date info.
if (preg_match('~%[AaBbCcDdeGghjmuYy](?:[^%]*%[AaBbCcDdeGghjmuYy])*~', $user_info['time_format'], $matches) == 0 || empty($matches[0]))
$context['playlist_time_format'] = $user_info['time_format'];
else
$context['playlist_time_format'] = $matches[0];
Find:
'time' => !empty($context['playlist_time_format']) ? timeformat($row['requestTime'], $context['playlist_time_format']) : timeformat($row['requestTime']),
Replace:
'time' => timeformat($row['requestTime']),
Thanks. It now works 100% perfectly. :)
Okay. We need some other testers now.
By the way, do you have any suggestions about language strings?
I changed the language strings specifically for my site. Here they are:
$txt['playlist_menu'] = 'Gamerz Garage Radio - Music Request';
$txt['playlist_title'] = 'Gamerz Garage Radio - Music Request';
$txt['playlist_songTitle'] = 'Song Title';
$txt['playlist_songArtist'] = 'Song Artist';
$txt['playlist_member'] = 'Member';
$txt['playlist_time'] = 'Time';
$txt['playlist_ip'] = 'IP';
$txt['playlist_state'] = 'Status';
$txt['playlist_action'] = 'Action';
$txt['playlist_view'] = 'List';
$txt['playlist_request'] = 'Request';
$txt['playlist_requestTitle'] = 'Music Request';
$txt['playlist_requestSubmist'] = 'Submit Request';
$txt['playlist_completed'] = 'Played';
$txt['playlist_pending'] = 'Pending';
$txt['playlist_change'] = 'Played';
$txt['playlist_remove'] = 'Remove';
$txt['playlist_description'] = 'Thank you for choosing to make a song request for Gamerz Garage Radio. Fill out the form below and your request will be displayed on the list of requested songs. If the radio is online, the song will be played when it\'s next on the list. When the status is marked "Played" then that means it is currently playing or has already been played.';
$txt['permissiongroup_playlist'] = 'Music Playlist';
$txt['permissionname_playlist_view'] = 'View music playlist';
$txt['permissionhelp_playlist_view'] = 'This permission allows users to see the playlist.';
$txt['permissionname_playlist_request'] = 'Make music request';
$txt['permissionhelp_playlist_request'] = 'This permission allows users to make music requests.';
$txt['permissionname_playlist_change'] = 'Change status of request';
$txt['permissionhelp_playlist_change'] = 'This permission allows users to change the status of the requests.';
$txt['permissionname_playlist_remove'] = 'Remove request';
$txt['permissionhelp_playlist_remove'] = 'This permission allows users to remove requests.';
$txt['permissionname_playlist_remove_own'] = 'Own request';
$txt['permissionname_playlist_remove_any'] = 'Any request';
$txt['permissionname_playlist_moderate'] = 'Moderate music playlist';
$txt['permissionhelp_playlist_moderate'] = 'This permission allows users to change, remove requests and see the ip of the user\'s that made request.';
$txt['cannot_playlist_view'] = 'Sorry, but you aren\'t allowed to view the Gamerz Garage Radio song request page.';
$txt['cannot_playlist_change'] = 'Sorry, but you aren\'t allowed to change the status of the played songs.';
$txt['cannot_playlist_remove_own'] = 'Sorry, but you aren\'t allowed to remove your own song requests.';
$txt['cannot_playlist_remove_any'] = 'Sorry, but you aren\'t allowed to remove song requests.';
$txt['cannot_playlist_request'] = 'Sorry, but you aren\'t allowed to make song requests.';
I added $txt['playlist_description'] to make a description show above the request form which the code to make it work is:
// Here comes our form.
echo '
<form action="', $scripturl, '?action=playlistadd" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">
<table border="0" width="50%" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>
', $txt['playlist_requestTitle'], '
</td>
</tr><tr>
<td class="windowbg" valign="middle" align="center" style="padding-bottom: 1ex; padding-top: 2ex;">
<div class="smalltext">', $txt['playlist_description'], '</div>
<table>
<tr>
<td align="right" style="font-weight: bold;" id="caption_songTitle">
', $txt['playlist_songTitle'], ':
</td>
<td>
<input type="text" name="songTitle" tabindex="', $context['tabindex']++, '" size="25" maxlength="80" />
</td>
</tr>
<tr>
<td align="right" style="font-weight: bold;" id="caption_songArtist">
', $txt['playlist_songArtist'], ':
</td>
<td>
<input type="text" name="songArtist" tabindex="', $context['tabindex']++, '" size="25" maxlength="80" />
</td>
</tr>';
Thanks,
brianjw
Looks good, will use them.
2 new features added.
- Mass (Quick) moderation
- Playlist moderators can remove, make played and pending many requests at a time
- Users who has the moderate playlist permission do not need to enter verification code
The "Your request is saved" issue will cause me to get mad, I'll add it. :P
Have you updated it in your post? ???
Quote from: brianjw on June 03, 2008, 04:18:42 PM
Have you updated it in your post? ???
Not yet, but I'll update it soon.
Okay, here we go. MusicPlaylist 1.0 Beta.
Tomorrow language strings will be revised and the package will be sent to the mod site.
At last the package is sent to the Mod Site.
I guess it will take a bit to be approved as it is a quite large mod.
So the turn is yours Customization Team.
[SiNaN],
Given your skills, you should seriously consider doing a football score prediction MOD... now that would be the MVM of SMF ;)
Lot's of ideas I have, but no time available.
Ellerine sağlık güzel kardeş...
mod silinmiş sanırım :/
eski forumuma eklediğim en güzel modlardan biriydi.
tekrar paylaşılacakmı ?
Can your Script be modded to work outside a SMF Forum ? Like just on a regular PHP site ... ? I really like your layout and format and would really like to use it ... please let me know Thanks so much
I was looking for a playlist mod and came across this one.
I decided to try to update this mod for 2.0.4 as a little project to help me understang the coding of SMF.
I've got the main script working as the original did, just a little bit more to do, but its been a nice experience learning the procedure of creating mods (even though technically i've just updated one)
@[SiNaN] Could I re-submit this version to the mod team for re-adding? Obviously i will credit you for the original concept.