Explorar el Código

Added link to the video for youtube feeds, removed the url validation in jQuery, we must find another way later

ravenlp hace 17 años
padre
commit
78ee1d2ec3
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 1 2
      admin/feeds.php
  2. 5 0
      classes/feeds.class.php

+ 1 - 2
admin/feeds.php Ver fichero

@@ -55,8 +55,7 @@ if ($user->isAdmin()) {
55 55
 			$("#feedform").validate({
56 56
 				rules: {
57 57
 					url: {
58
-						required: true,
59
-						url: true
58
+						required: true
60 59
 					}
61 60
 				},
62 61
 				errorElement: "span",

+ 5 - 0
classes/feeds.class.php Ver fichero

@@ -86,7 +86,12 @@ class feeds extends Conexion_Mysql {
86 86
 									if($post->get_title()  != $post->get_description()){
87 87
 										if(strpos($feed['url'],'twitter.com') <= 0){
88 88
 											$newPost['description'] = $post->get_description();
89
+											if(strpos($feed['url'],'youtube.com') > 0){
90
+												$newPost['description'] = preg_replace('/\<img ([^\>]+)/','<a href="'.$post->get_link().'"><img $1></a',$post->get_description());
91
+												
92
+											}
89 93
 										}
94
+
90 95
 									}
91 96
 								}elseif($feed['type'] == 2){ //IMAGES
92 97
 									$ma = array();