Create editable variable links in ACP

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
User avatar
Lobo_UU
Registered User
Posts: 39
Joined: Sat Dec 31, 2005 6:37 am
Location: Earth
Contact:

Create editable variable links in ACP

Post by Lobo_UU » Wed Mar 22, 2006 12:39 am

Image

Ok, so as you can see I have already created the table I want in the index_body.tpl

Code: Select all

	<table border="0" cellspacing="0" cellpadding="0" align="center" height="50">
		<tr>
			<td background="http://www.unknownunderground.com/forums/templates/AcidTech/images/cell.gif">
				<div align="center">
					<img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_left.gif" alt="" height="25" width="27" border="0"><img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_mid.gif" alt="" height="25" width="91" border="0"><img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_right.gif" alt="" height="25" width="27" border="0"><br>
					<font size="-1" color="white">Show 9</font><font size="-1"><br>
					</font><font size="-1" color="yellow"><a href="http://www.unknownunderground.com/shows/show9web-broadband.mp3">Hi-Fi</a> </font><font size="-1" color="white">-</font><font size="-1" color="yellow"> <a href="http://www.unknownunderground.com/shows/show9web.mp3">Lo-Fi</a></font></div>
			</td>
		</tr>
	</table>
That is the code I used to create it as well..

Now so I don't have to keep manually going in and editing the code of index_body.tpl with every episode of my show that I upload to my site I was wondering how to make it possible that I can assign the links and the number of the text of "Show 9" so that I can go into the ACP and enter the episode number. So say when me and my crew site down and record Show 10 what do I need to do to make it so that I can go into the ACP and just enter the number 10 and it will change the number in the text "Show 9" to "Show 10" and update the number in the links for the download?
Last edited by Lobo_UU on Thu Mar 23, 2006 12:34 am, edited 1 time in total.
I suck at this.. but hey with all your guys' help I'm learning at least! slowly

User avatar
Lobo_UU
Registered User
Posts: 39
Joined: Sat Dec 31, 2005 6:37 am
Location: Earth
Contact:

Post by Lobo_UU » Wed Mar 22, 2006 10:37 am

Code: Select all

##############################################################
## MOD Title: Show_Updater
## MOD Author: Lobo_UU < lobo@unknownunderground.com > (Lobo Canidae) http://www.unknownunderground.com
## MOD Description: Um... should update my durn show links
## MOD Version: 1.0.0
## 
## Installation Level: Hard
## Installation Time: 3 minutes
## Files To Edit: templates/subSilver/index_body.tpl
## Included Files: 
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
## Generator: MOD Studio [ ModTemplateTools 1.0.2232.38226 ]
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: I REAAAAALLY need the help of the professionals at PHPBB.com LOL!
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	<table border="0" cellspacing="0" cellpadding="0" align="center" height="50">
		<tr>
			<td background="http://www.unknownunderground.com/forums/templates/AcidTech/images/cell.gif">
				<div align="center">
					<img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_left.gif" alt="" height="25" width="27" border="0"><img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_mid.gif" alt="" height="25" width="91" border="0"><img src="http://www.unknownunderground.com/forums/templates/AcidTech/images/hdr_right.gif" alt="" height="25" width="27" border="0"><br>
					<font size="-1" color="white">Show 9</font><font size="-1"><br>
					</font><font size="-1" color="yellow"><a href="http://www.unknownunderground.com/shows/show9web-broadband.mp3">Hi-Fi</a> </font><font size="-1" color="white">-</font><font size="-1" color="yellow"> <a href="http://www.unknownunderground.com/shows/show9web.mp3">Lo-Fi</a></font></div>
			</td>
		</tr>
	</table>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Okay so I've got the MOD file partially started.. I'm terrible at this so please bear with me. I still need to figure out how to make it so that the table's links that are created at the top of the page can be updated in the AdminCP. So where it says..
<font size="-1" color="yellow"> <a href="http://www.unknownunderground.com/shows ... font></div>


I need to make it so that I can enter a 10 into a text box in the ACP for the next show and have it update both links numbers and the text "Show 9" to "Show 10".

I just really don't want to muck this up and all help is SOOO appriciated. :D
I suck at this.. but hey with all your guys' help I'm learning at least! slowly

User avatar
Lobo_UU
Registered User
Posts: 39
Joined: Sat Dec 31, 2005 6:37 am
Location: Earth
Contact:

Post by Lobo_UU » Wed Mar 22, 2006 9:45 pm

OK so I've downloaded a couple other MODs that have worked with my board again and read over them trying to assimilate the code considering I've never actually studied this particular code top to bottom, in and out, etc etc.. yet and from what I can tell..

..I need to edit the admin/admin_board.php file?


*fizzle* I'm so lost... please I beg of all you who are better trained in the majestic language of php.. :cry: *on knees*.. I am "teh n00b" lol!
I suck at this.. but hey with all your guys' help I'm learning at least! slowly

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove » Thu Mar 23, 2006 9:44 am

What I would do is sit down and design first. I gather you make regular shows in various quality and put them like here:
/shows/show9web.mp3

I would organise the folders first, like this:
/shows/dsl/show_9.mp3
/shows/lofi/show_9.mp3
so you can retrieve the show number from the file name later.

I then would code the php to search:
1. All folders under /shows/ (returns dsl and lofi)
2. The newest files in each folder
3. Extract the show number from the file name (assumption: the newest file really is the newest show, and the newest show file is present in all folders)

With these variables (all file names and one show number) you can now build your template, without ever having to change the template or the php file again, just upload the next show with the correct name and the existing php code will do the rest.

You'll find examples on how to read folders and files in phpBB, in functions_select.php where selection boxes are made, look for keywords like dir and list

Post Reply

Return to “[2.0.x] MOD Requests”