News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Song Request PHP Script

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

Previous topic - Next topic

[SiNaN]

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']),

Former SMF Core Developer | My Mods | SimplePortal

brianjw

Thanks. It now works 100% perfectly. :)

[SiNaN]

Okay. We need some other testers now.

By the way, do you have any suggestions about language strings?
Former SMF Core Developer | My Mods | SimplePortal

brianjw

#23
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:
Code (Playlist.template.php) Select

// 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

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

[SiNaN]

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
Former SMF Core Developer | My Mods | SimplePortal

brianjw

Have you updated it in your post? ???

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

[SiNaN]

Okay, here we go. MusicPlaylist 1.0 Beta.

Tomorrow language strings will be revised and the package will be sent to the mod site.
Former SMF Core Developer | My Mods | SimplePortal

[SiNaN]

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.

Former SMF Core Developer | My Mods | SimplePortal

Paracelsus

[SiNaN],

Given your skills, you should seriously consider doing a football score prediction MOD... now that would be the MVM of SMF ;)

[SiNaN]

Lot's of ideas I have, but no time available.
Former SMF Core Developer | My Mods | SimplePortal

cee山

Ellerine sağlık güzel kardeş...

hhmercan

mod silinmiş sanırım :/
eski forumuma eklediğim en güzel modlardan biriydi.
tekrar paylaşılacakmı ?

Midnite007

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

ricktee76

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.

Advertisement: