Merge branch 'master' of
ssh://gitolite@asdynamics.com:50005/projects/fdn2.git Conflicts: private/lib/gui/GUIHandler.php
This commit is contained in:
@@ -81,7 +81,17 @@ $dati = $statement->fetchALL(PDO::FETCH_CLASS,"stdClass");
|
||||
if (preg_match("/^http/",$ele->img)){
|
||||
$media = new stdClass();
|
||||
$media->mediaType = MediaModel::TYPE_YOUTUBE;
|
||||
$media->link = $ele->img;
|
||||
$matches = array();
|
||||
if ( preg_match("~^http[s]?[:]//youtu\.be/(.+)$~", trim($ele->img), $matches) ){
|
||||
$media->link = $matches[1];
|
||||
}
|
||||
else if (preg_match("~http[s]?[:]//www\.youtube\.com/embed/([^\"]+)[\"]~", trim($ele->img), $matches)){
|
||||
$media->link = $matches[1];
|
||||
}
|
||||
else if (preg_match("~http[s]?[:]//www\.youtube\.com/watch[?]v[=](.+)$~", trim($ele->img), $matches)){
|
||||
$media->link = $matches[1];
|
||||
}
|
||||
// $media->link = $ele->img;
|
||||
$media = new MediaModel($media);
|
||||
GlobalVariables::get("dao")->save($media);
|
||||
DaoMediaHandler::addMedia($notizia, $media);
|
||||
|
||||
Reference in New Issue
Block a user