Ver código fonte

Style details

ravenlp 16 anos atrás
pai
commit
8e141a5239

+ 2 - 2
admin/bm.php Ver arquivo

@@ -57,8 +57,8 @@ if ($user->isAdmin()) {
57 57
 			$_POST["description"] = addslashes($_POST["description"]);
58 58
 		}		
59 59
 		
60
-		$_POST["title"] = removeBadTags($_POST["title"],true);
61
-		$_POST["description"] = removeBadTags($_POST["description"]);
60
+		$_POST["title"] = util::removeBadTags($_POST["title"],true);
61
+		$_POST["description"] = util::removeBadTags($_POST["description"]);
62 62
 
63 63
 		if ($tumble->addPost($_POST)) {
64 64
 			$input = array("{type}");

+ 3 - 3
admin/css/style.css Ver arquivo

@@ -29,9 +29,9 @@ fieldset{ border:none; margin:0; padding:0;}
29 29
 
30 30
 /*********** LAYOUT *************/
31 31
 
32
-body{ background: #e0e0e0; text-align:center; font-family:"Trebuchet Ms", Verdana, Tahoma; font-size:1em;}
32
+body{ background-color: #e0e0e0; text-align:center; font-family:"Trebuchet Ms", Verdana, Tahoma; font-size:1em;}
33 33
 
34
-#cont{ width:600px; margin:30px auto 20px auto; text-align:left; border: 1px solid #999;}
34
+#cont{ width:600px; margin:30px auto 20px auto; text-align:left; border: 1px solid #999; background-color: #FFF; padding:10px 0 0 0;}
35 35
 
36 36
 #head{ background: #fff url(images/head_bg.png) bottom center no-repeat; position: relative; padding:10px 0 20px 20px; height:73px;}
37 37
 	h1 a{ display:block; height:77px; width:161px; background:#fff url(images/gelato-logo.png) top left no-repeat; text-indent:-9999px; overflow:hidden;}
@@ -119,7 +119,7 @@ fieldset.install input.txt{width:468px;}
119 119
 .post .audio{}
120 120
 
121 121
 
122
-#foot { border-top:1px solid #999999; color:#000000; font-size:10px; padding:5px 10px; text-align:center;}
122
+#foot { border-top:1px solid #999999; color:#000000; font-size:10px; padding:5px 10px; text-align:center; background-color: #e0e0e0;}
123 123
 
124 124
 	#footer a { color: #000; }
125 125
 	

+ 10 - 10
admin/index.php Ver arquivo

@@ -40,20 +40,20 @@ if ($user->isAuthenticated()) {
40 40
 
41 41
         if(isset($_POST["btnAdd"])){
42 42
                 unset($_POST["btnAdd"]);
43
-                $_POST['type'] = type2Number($_POST['type']);
43
+                $_POST['type'] = util::type2Number($_POST['type']);
44 44
 
45 45
                 if ($_POST["type"]=="2") { // is Photo type
46 46
                         if (isset($_POST["url"]) && $_POST["url"]!="")  {
47
-                                $photoName = getFileName($_POST["url"]);
47
+                                $photoName = util::getFileName($_POST["url"]);
48 48
                                 if (!$tumble->savePhoto($_POST["url"])) {
49 49
                                         header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
50 50
                                         die();
51 51
                                 }
52
-                                $_POST["url"] = "../uploads/".sanitizeName($photoName);
52
+                                $_POST["url"] = "../uploads/".util::sanitizeName($photoName);
53 53
                         }
54 54
 
55
-                        if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".sanitizeName($_FILES['photo']['name']) ) ) {
56
-                                $_POST["url"] = "../uploads/".sanitizeName($_FILES['photo']['name']);
55
+                        if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".util::sanitizeName($_FILES['photo']['name']) ) ) {
56
+                                $_POST["url"] = "../uploads/".util::sanitizeName($_FILES['photo']['name']);
57 57
                         }
58 58
 
59 59
                         unset($_POST["photo"]);
@@ -62,7 +62,7 @@ if ($user->isAuthenticated()) {
62 62
 
63 63
                 if ($_POST["type"]=="7") { // is MP3 type
64 64
                         set_time_limit(300);
65
-                        $mp3Name = getFileName($_POST["url"]);
65
+                        $mp3Name = util::getFileName($_POST["url"]);
66 66
                         if (!$tumble->saveMP3($_POST["url"])) {
67 67
                                 header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
68 68
                                 die();
@@ -84,8 +84,8 @@ if ($user->isAuthenticated()) {
84 84
                 $_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
85 85
                 */
86 86
 
87
-                $_POST["title"] = removeBadTags($_POST["title"],true);
88
-                $_POST["description"] = removeBadTags($_POST["description"]);
87
+                $_POST["title"] = util::removeBadTags($_POST["title"],true);
88
+                $_POST["description"] = util::removeBadTags($_POST["description"]);
89 89
 
90 90
                 if (isset($_POST["id_post"]) and  is_numeric($_POST["id_post"]) and $_POST["id_post"]>0) {
91 91
                         $tumble->modifyPost($_POST, $_POST["id_post"]);
@@ -249,7 +249,7 @@ if ($user->isAuthenticated()) {
249 249
                                                         $row['Body'] = $register["description"];
250 250
                                                         break;
251 251
                                                 case "2":
252
-                                                        $fileName = "../uploads/".getFileName($register["url"]);
252
+                                                        $fileName = "../uploads/".util::getFileName($register["url"]);
253 253
 
254 254
                                                         $x = @getimagesize($fileName);
255 255
                                                         if ($x[0] > 100)
@@ -270,7 +270,7 @@ if ($user->isAuthenticated()) {
270 270
                                                         break;
271 271
                                                 case "4":
272 272
                                                         if($conf->shorten_links)
273
-                                                                $register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
273
+                                                                $register["url"] = util::_file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
274 274
                                                         $register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
275 275
 
276 276
                                                         $row['URL'] = $register["url"];

+ 1 - 1
admin/settings.php Ver arquivo

@@ -18,7 +18,7 @@ if ($user->isAdmin()) {
18 18
 	
19 19
 	if(isset($_POST["btnsubmit"]))	{		
20 20
 		unset($_POST["btnsubmit"]);
21
-		$_POST["url_installation"] = (endsWith($_POST["url_installation"], "/")) ? substr($_POST["url_installation"], 0, strlen($_POST["url_installation"])-1) : $_POST["url_installation"] ;
21
+		$_POST["url_installation"] = (util::endsWith($_POST["url_installation"], "/")) ? substr($_POST["url_installation"], 0, strlen($_POST["url_installation"])-1) : $_POST["url_installation"] ;
22 22
 		$tumble->saveSettings($_POST);
23 23
 	} else {
24 24
 ?>

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
admin/themes/admin/index.htm


+ 1 - 1
admin/themes/admin/template_add_photo.htm Ver arquivo

@@ -13,7 +13,7 @@
13 13
 
14 14
 	<div id="photo_url">
15 15
 		<label for="description">Photo URL</label>
16
-		<br /><input class="input-text" type="text" name="url" id="url" size="80" value="{editUrl}" />
16
+		<br /><input class="input-text" type="text" name="url" id="url" value="{editUrl}" style="width:400px"/>
17 17
 		<div style="font-size:11px; color:#666; margin-top:5px;">
18 18
 			<a href="#" class="linkFrm">Use a upload form instead</a>
19 19
 		</div>

+ 19 - 19
classes/gelato.class.php Ver arquivo

@@ -142,7 +142,7 @@ class gelato {
142 142
 	}
143 143
 
144 144
 	function saveMP3($remoteFileName) {
145
-		if (getMP3File($remoteFileName)) {
145
+		if (util::getMP3File($remoteFileName)) {
146 146
 			return true;
147 147
 		} else {
148 148
 			return false;
@@ -150,7 +150,7 @@ class gelato {
150 150
 	}
151 151
 
152 152
 	function savePhoto($remoteFileName) {
153
-		if (getPhotoFile($remoteFileName)) {
153
+		if (util::getPhotoFile($remoteFileName)) {
154 154
 			return true;
155 155
 		} else {
156 156
 			return false;
@@ -158,38 +158,38 @@ class gelato {
158 158
 	}
159 159
 
160 160
 	function getVideoPlayer($url) {
161
-		if (isYoutubeVideo($url)) {
162
-			$id_video = getYoutubeVideoUrl($url);
161
+		if (util::isYoutubeVideo($url)) {
162
+			$id_video = util::getYoutubeVideoUrl($url);
163 163
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.youtube.com/v/".$id_video."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id_video."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
164
-		} elseif (isVimeoVideo($url)) {
165
-			$id_video = getVimeoVideoUrl($url);
164
+		} elseif (util::isVimeoVideo($url)) {
165
+			$id_video = util::getVimeoVideoUrl($url);
166 166
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
167
-		} elseif (isDailymotionVideo($url)) {
168
-			$id_video = getDailymotionVideoUrl($url);
167
+		} elseif (util::isDailymotionVideo($url)) {
168
+			$id_video = util::getDailymotionVideoUrl($url);
169 169
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.dailymotion.com/swf/".$id_video."\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/".$id_video."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
170
-		} elseif (isYahooVideo($url)) {
171
-			$id_video = getYahooVideoCode($url);
170
+		} elseif (util::isYahooVideo($url)) {
171
+			$id_video = util::getYahooVideoCode($url);
172 172
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"event_function=YAHOO.yv.Player.SWFInterface&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
173
-		} elseif (isSlideSharePresentation($url)) {
174
-			$id_video = getSlideSharePresentationCode($url);
173
+		} elseif (util::isSlideSharePresentation($url)) {
174
+			$id_video = util::getSlideSharePresentationCode($url);
175 175
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.slideshare.net/swf/player.swf?presentationId=".$id_video[0]."&amp;doc=".$id_video[1]."&amp;inContest=0&amp;startSlide=1\"><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
176
-		} elseif (isGoogleVideoUrl($url)) {
177
-			$id_video = getGoogleVideoCode($url);
176
+		} elseif (util::isGoogleVideoUrl($url)) {
177
+			$id_video = util::getGoogleVideoCode($url);
178 178
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://video.google.com/googleplayer.swf?docid=".$id_video."&amp;hl=es&amp;fs=true\"><param name=\"movie\" value=\"http://video.google.com/googleplayer.swf?docid=".$id_video."&amp;hl=es&amp;fs=true\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
179
-		} elseif (isMTVVideoUrl($url)) {
180
-			$id_video = getMTVVideoCode($url);
179
+		} elseif (util::isMTVVideoUrl($url)) {
180
+			$id_video = util::getMTVVideoCode($url);
181 181
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://media.mtvnservices.com/mgid:uma:video:mtvmusic.com:".$id_video."\"><param name=\"movie\" value=\"http://media.mtvnservices.com/mgid:uma:video:mtvmusic.com:".$id_video."\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"never\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";	
182 182
 		} else {
183 183
 			return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video, MTV or SlideShare)";
184 184
 		}
185 185
 	}
186 186
 	function getMp3Player($url) {
187
-		if (isMP3($url)) {
187
+		if (util::isMP3($url)) {
188 188
 			$playerUrl = $conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;
189 189
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"" . $playerUrl . "\" width=\"290\" height=\"24\"><param name=\"movie\" value=\"" . $playerUrl . "\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
190
-		} elseif (isGoEar($url)) {
190
+		} elseif (util::isGoEar($url)) {
191 191
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://www.goear.com/files/external.swf\" width=\"366\" height=\"130\"><param name=\"movie\" value=\"http://www.goear.com/files/external.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"file=".getGoEarCode($url)."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
192
-		} elseif (isOdeo($url)) {
192
+		} elseif (util::isOdeo($url)) {
193 193
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://media.odeo.com/flash/odeo_player.swf?v=3\" width=\"366\" height=\"75\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"type=audio&amp;id=".getOdeoCode($url)."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
194 194
 		} else {
195 195
 			return "This URL is not an MP3 file.";

+ 8 - 8
index.php Ver arquivo

@@ -60,9 +60,9 @@ $theme = new themes;
60 60
 			$register = $tumble->getPost($id_post);
61 61
 			if (empty($register["title"])) {
62 62
 				if (!empty($register["description"])) {
63
-					$page_title_data = trimString($register["description"], $page_title_len);
63
+					$page_title_data = util::trimString($register["description"], $page_title_len);
64 64
 				} else {
65
-					$page_title_data =  type2Text($register["type"]);
65
+					$page_title_data =  util::type2Text($register["type"]);
66 66
 				}
67 67
 			} else {
68 68
 				$page_title_data = $register["title"];
@@ -123,7 +123,7 @@ $theme = new themes;
123 123
 											$row['Body'] = $register["description"];
124 124
 											break;
125 125
 											case "2":
126
-											$fileName = "uploads/".getFileName($register["url"]);
126
+											$fileName = "uploads/".util::getFileName($register["url"]);
127 127
 											$x = @getimagesize($fileName);
128 128
 												if ($x[0] > 500) {
129 129
 													$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
@@ -144,7 +144,7 @@ $theme = new themes;
144 144
 												break;
145 145
                                         case "4":
146 146
 												if($conf->shorten_links){
147
-													$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
147
+													$register["url"] = util::_file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
148 148
 												}
149 149
 												$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
150 150
 
@@ -219,7 +219,7 @@ $theme = new themes;
219 219
 								$row['Body'] = $register["description"];
220 220
 								break;
221 221
 						case "2":
222
-								$fileName = "uploads/".getFileName($register["url"]);
222
+								$fileName = "uploads/".util::getFileName($register["url"]);
223 223
 
224 224
 								$x = @getimagesize($fileName);
225 225
 								if ($x[0] > 500) {
@@ -241,7 +241,7 @@ $theme = new themes;
241 241
 								break;
242 242
 						case "4":
243 243
 							if($conf->shorten_links){
244
-									$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
244
+									$register["url"] = util::_file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
245 245
 								}
246 246
 								$row['URL'] = $register["url"];
247 247
 								$row['Name'] = $register["title"];
@@ -268,9 +268,9 @@ $theme = new themes;
268 268
 
269 269
 					if (empty($register["title"])) {
270 270
 						if (!empty($register["description"])) {
271
-							$postTitle = trimString($register["description"]);
271
+							$postTitle = util::trimString($register["description"]);
272 272
 						} else {
273
-							$postTitle =  type2Text($register["type"]);
273
+							$postTitle =  util::type2Text($register["type"]);
274 274
 						}
275 275
 					} else {
276 276
 						$postTitle = $register["title"];