| @@ 1109-1198 (lines=90) @@ | ||
| 1106 | continue; |
|
| 1107 | } // Avoid code - that should help. |
|
| 1108 | ||
| 1109 | if ($attr == 'value') { |
|
| 1110 | if (strpos($source, 'mp3file')) { |
|
| 1111 | $files_list[] = array( |
|
| 1112 | substr( |
|
| 1113 | $source, |
|
| 1114 | 0, |
|
| 1115 | strpos( |
|
| 1116 | $source, |
|
| 1117 | '.swf' |
|
| 1118 | ) + 4 |
|
| 1119 | ), |
|
| 1120 | 'local', |
|
| 1121 | 'abs' |
|
| 1122 | ); |
|
| 1123 | $mp3file = substr( |
|
| 1124 | $source, |
|
| 1125 | strpos( |
|
| 1126 | $source, |
|
| 1127 | 'mp3file=' |
|
| 1128 | ) + 8 |
|
| 1129 | ); |
|
| 1130 | if (substr( |
|
| 1131 | $mp3file, |
|
| 1132 | 0, |
|
| 1133 | 1 |
|
| 1134 | ) == '/' |
|
| 1135 | ) { |
|
| 1136 | $files_list[] = array( |
|
| 1137 | $mp3file, |
|
| 1138 | 'local', |
|
| 1139 | 'abs' |
|
| 1140 | ); |
|
| 1141 | } else { |
|
| 1142 | $files_list[] = array( |
|
| 1143 | $mp3file, |
|
| 1144 | 'local', |
|
| 1145 | 'rel' |
|
| 1146 | ); |
|
| 1147 | } |
|
| 1148 | } elseif (strpos( |
|
| 1149 | $source, |
|
| 1150 | 'flv=' |
|
| 1151 | ) === 0 |
|
| 1152 | ) { |
|
| 1153 | ||
| 1154 | $source = substr($source, 4); |
|
| 1155 | if (strpos($source, '&') > 0) { |
|
| 1156 | $source = substr( |
|
| 1157 | $source, |
|
| 1158 | 0, |
|
| 1159 | strpos($source, '&') |
|
| 1160 | ); |
|
| 1161 | } |
|
| 1162 | if (strpos( |
|
| 1163 | $source, |
|
| 1164 | '://' |
|
| 1165 | ) > 0 |
|
| 1166 | ) { |
|
| 1167 | if (strpos( |
|
| 1168 | $source, |
|
| 1169 | api_get_path( |
|
| 1170 | WEB_PATH |
|
| 1171 | ) |
|
| 1172 | ) !== false |
|
| 1173 | ) { |
|
| 1174 | // We found the current portal url. |
|
| 1175 | $files_list[] = array( |
|
| 1176 | $source, |
|
| 1177 | 'local', |
|
| 1178 | 'url' |
|
| 1179 | ); |
|
| 1180 | } else { |
|
| 1181 | // We didn't find any trace of current portal. |
|
| 1182 | $files_list[] = array( |
|
| 1183 | $source, |
|
| 1184 | 'remote', |
|
| 1185 | 'url' |
|
| 1186 | ); |
|
| 1187 | } |
|
| 1188 | } else { |
|
| 1189 | $files_list[] = array( |
|
| 1190 | $source, |
|
| 1191 | 'local', |
|
| 1192 | 'abs' |
|
| 1193 | ); |
|
| 1194 | } |
|
| 1195 | continue; // Skipping anything else to avoid two entries |
|
| 1196 | //(while the others can have sub-files in their url, flv's can't). |
|
| 1197 | } |
|
| 1198 | } |
|
| 1199 | ||
| 1200 | if (strpos($source, '://') > 0) { |
|
| 1201 | ||
| @@ 2162-2191 (lines=30) @@ | ||
| 2159 | continue; //avoid code - that should help |
|
| 2160 | } |
|
| 2161 | ||
| 2162 | if ($attr == 'value') { |
|
| 2163 | if (strpos($source, 'mp3file')) { |
|
| 2164 | $files_list[] = array(substr($source, 0, strpos($source, '.swf') + 4), 'local', 'abs'); |
|
| 2165 | $mp3file = substr($source, strpos($source, 'mp3file=') + 8); |
|
| 2166 | if (substr($mp3file, 0, 1) == '/') { |
|
| 2167 | $files_list[] = array($mp3file, 'local', 'abs'); |
|
| 2168 | } else { |
|
| 2169 | $files_list[] = array($mp3file, 'local', 'rel'); |
|
| 2170 | } |
|
| 2171 | } elseif (strpos($source, 'flv=') === 0) { |
|
| 2172 | $source = substr($source, 4); |
|
| 2173 | if (strpos($source, '&') > 0) { |
|
| 2174 | $source = substr($source, 0, strpos($source, '&')); |
|
| 2175 | } |
|
| 2176 | if (strpos($source, '://') > 0) { |
|
| 2177 | if (strpos($source, api_get_path(WEB_PATH)) !== false) { |
|
| 2178 | //we found the current portal url |
|
| 2179 | $files_list[] = array($source, 'local', 'url'); |
|
| 2180 | } else { |
|
| 2181 | //we didn't find any trace of current portal |
|
| 2182 | $files_list[] = array($source, 'remote', 'url'); |
|
| 2183 | } |
|
| 2184 | } else { |
|
| 2185 | $files_list[] = array($source, 'local', 'abs'); |
|
| 2186 | } |
|
| 2187 | /* skipping anything else to avoid two entries |
|
| 2188 | (while the others can have sub-files in their url, flv's can't)*/ |
|
| 2189 | continue; |
|
| 2190 | } |
|
| 2191 | } |
|
| 2192 | if (strpos($source, '://') > 0) { |
|
| 2193 | //cut at '?' in a URL with params |
|
| 2194 | if (strpos($source, '?') > 0) { |
|