PageRenderTime 21ms CodeModel.GetById 7ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/upload/templates/default/topic_templates/progs_mac.tpl

http://torrentpier2.googlecode.com/
Smarty Template | 151 lines | 142 code | 9 blank | 0 comment | 18 complexity | 6b9020e3461bc3423513a068fe3342fe MD5 | raw file
  1<script type="text/javascript">
  2var localization = ['{SEL_UI_LANG}'];
  3var medicine = ['{SEL_MEDICINE}'];
  4var torrent_sign = "{TORRENT_SIGN}";
  5
  6function make_format_list (what)
  7{
  8	var ret='';
  9	for (i=0; i<what.length; i++)
 10	{
 11		ret += '<option value="'+what[i]+'">'+what[i]+'</option>';
 12	}
 13	return ret;
 14}
 15function form_validate (f)
 16{
 17	var error='';
 18	var msg="\n\n";
 19
 20	if (f.elements["msg[release_name]"].value=='')
 21	{
 22		f.elements["msg[release_name]"].focus();
 23		error='{L_TITLE}';
 24		msg +='{L_TITLE_EXP}';
 25	}
 26	else if (f.elements["msg[picture]"].value!='' && !f.elements["msg[picture]"].value.match('^(http|https)://[^ \?&=\#\"<>]+?\.(jpg|jpeg|gif|png)$'))
 27	{
 28		f.elements["msg[picture]"].focus();
 29		error='{L_PICTURE}';
 30		msg +='{L_PICTURE_EXP}';
 31	}
 32	else if (f.elements["msg[year]"].value!='' && (isNaN(f.elements["msg[year]"].value) || f.elements["msg[year]"].value.length!=4))
 33	{
 34		f.elements["msg[year]"].focus();
 35		error='{L_YEAR}';
 36		msg +='{L_YEAR_EXP}';
 37	}
 38	else if (f.fileupload.value=='')
 39	{
 40		f.fileupload.focus();
 41		error='{L_TORRENT}';
 42		msg +='{L_TORRENT_EXP}';
 43	}
 44	else if (f.fileupload.value.substr(f.fileupload.value.length-{TORRENT_EXT_LEN})!='.{TORRENT_EXT}')
 45	{
 46		f.fileupload.focus();
 47		error='{L_TORRENT}';
 48		msg +='{L_TORRENT_EXP}';
 49	}
 50	else if (torrent_sign && f.fileupload.value.indexOf(torrent_sign) == -1)
 51	{
 52		f.fileupload.focus();
 53		error='{L_TORRENT}';
 54		msg +='{L_TORRENT_SIGN_EXP}';
 55	}
 56
 57	if (error) {
 58		alert('{L_ERROR}: '+error+msg);
 59		return false;
 60	}
 61	return true;
 62}
 63</script>
 64
 65<h1 class="maintitle"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h1>
 66
 67<div class="nav">
 68	<p class="floatL"><a href="{U_INDEX}">{T_INDEX}</a></p>
 69	<!-- IF REGULAR_TOPIC_BUTTON --><p class="floatR"><a href="{REGULAR_TOPIC_HREF}">{L_POST_REGULAR_TOPIC}</a></p><!-- ENDIF -->
 70	<div class="clear"></div>
 71</div>
 72
 73<?php require($GLOBALS['bb_cfg']['topic_tpl']['overall_header']) ?>
 74
 75<form action="{S_ACTION}" method="post" name="post" onsubmit="return form_validate(this);" enctype="multipart/form-data">
 76<input type="hidden" name="preview" value="1">
 77
 78<table class="forumline">
 79<col class="row1" width="20%">
 80<col class="row2" width="80%">
 81<tr>
 82	<th colspan="2">{L_RELEASE_WELCOME}</th>
 83</tr>
 84<tr>
 85	<td><b>{L_TITLE}</b>:</td>
 86	<td><input type="text" name="msg[release_name]" maxlength="90" size="80" /></td>
 87</tr>
 88<tr>
 89	<td><b>{L_PICTURE}</b>:</td>
 90	<td><input type="text" name="msg[picture]" size="80" /> <span class="med">URL</span></td>
 91</tr>
 92<tr>
 93	<td><b>{L_YEAR}</b>:</td>
 94	<td><input type="text" name="msg[year]" maxlength="4" size="5" /></td>
 95</tr>
 96<tr>
 97	<td><b>{L_VERSION}</b>:</td>
 98	<td><input type="text" name="msg[version]" size="30" /></td>
 99</tr>
100<tr>
101	<td><b>{L_DEVELOPER}</b>:</td>
102	<td><input type="text" name="msg[developer][name]" size="60" /></td>
103</tr>
104<tr>
105	<td><b>{L_DEVELOPER_URL}</b>:</td>
106	<td><input type="text" name="msg[developer][url]" size="60" /> <span class="med">URL</span></td>
107</tr>
108<tr>
109	<td><b>{L_PLATFORM}</b>:</td>
110	<td>
111		<select name="msg[platform]"><option value="">&raquo; {L_SELECT}</option>
112			<option value="PPC only">PPC only</option>
113			<option value="PPC/Intel universal">PPC/Intel universal</option>
114			<option value="Intel only">Intel only</option>
115			<option value="PC">PC</option>
116		</select>&nbsp;
117		<select name="msg[localization]"><option value="">&raquo; {L_LOCALIZATION}</option><script type="text/javascript">document.writeln(make_format_list(localization));</script></select>&nbsp;
118		<select name="msg[medicine]"><option value="">&raquo; {L_MEDICINE}</option><script type="text/javascript">document.writeln(make_format_list(medicine));</script></select>&nbsp;
119	</td>
120</tr>
121<tr>
122	<td><b>{L_SYS_REQUIREMENTS}</b>:</td>
123	<td><textarea name="msg[sys_requirements]" rows="3" cols="100" class="editor"></textarea></td>
124</tr>
125<tr>
126	<td><b>{L_DESCRIPTION}</b>:</td>
127	<td><textarea name="msg[description]" rows="10" cols="100" class="editor"></textarea></td>
128</tr>
129<tr>
130	<td><b>{L_MOREINFO}</b>:</td>
131	<td><textarea name="msg[moreinfo]" rows="3" cols="100" class="editor"></textarea></td>
132</tr>
133<tr>
134	<td><b>{L_SCREEN_SHOTS}</b>:</td>
135	<td><textarea name="msg[screen_shots]" rows="3" cols="100" class="editor"></textarea> <span class="med">URLs</span></td>
136</tr>
137<tr>
138	<td><b>{L_TORRENT}</b>:</td>
139	<td>
140		<p><input type="file" name="fileupload" size="65" /></p>
141		<p class="med">{L_TORRENT_EXP}</p>
142	</td>
143</tr>
144<tr>
145	<td class="catBottom" colspan="2">
146		<input type="submit" name="add_attachment" value="{L_NEXT}" class="bold" />
147	</td>
148</tr>
149</table>
150
151</form>