{jr_create_directory}
Overview:
The {jr_create_directory} template function is a very powerful template function that can be used to create directories and process templates from within a Jamroom Template. The created directories, and output of the processed template(s) will be placed into the given band_id's member/media/upload directory.
Usage:
Place the {jr_create_directory} function, along with any additional parameters into a Jamroom Template.
Parameters:
Name |
Type |
Required |
Default |
Description |
band_id |
number |
yes |
n/a |
The "band_id" parameter tells Jamroom which band_id you want to run the function for. |
name |
string |
yes |
n/a |
The "name" function tells Jamroom the name of the sub directory you want created within the profiles directory - i.e. members/band_id/directory_name. When called, if the directory does not exist, it will be created.
|
dir |
string |
no |
"member" |
The "dir" parameter tells Jamroom which Jamroom directory you want the sub directory created within. Valid values are "member" (use this even if your member directory is named something else), "media" (use this even if your media directory is named something else) or "uploads". |
files |
array |
no |
n/a |
The optional "files" parameter should be an array (prepared using the {jr_array} template function) of Templates => Out File names that you want the function to process. The template MUST be located in the theme directory for the profile theme being used by the band_id. |
Examples:
embedded {jr_create_directory} function which creates a "test" sub directory in band_id 5's members directory, and writes an index.html file inside that directory:
{jr_array name="files" key="test_index.tpl" value="index.html"}
{jr_create_directory band_id="5" name="test" dir="member" files=$files}
|
contents of jamroom/themes/Theme_Name/test_index.tpl:
<html>
<head>
<title>Welcome to the test page for {$BAND_ID}</title>
</head>
<body>
Welcome to the test page for {$BAND_NAME}!
</body>
</html>
|
|