diff --git a/3.0/modules/embedlinks/controllers/embedlinks.php b/3.0/modules/embedlinks/controllers/embedlinks.php
index 2ff53b1a..5a7b70cb 100644
--- a/3.0/modules/embedlinks/controllers/embedlinks.php
+++ b/3.0/modules/embedlinks/controllers/embedlinks.php
@@ -50,8 +50,33 @@ class EmbedLinks_Controller extends Controller {
if (access::can("view_full", $item)) {
$linkArray[2] = array("Text:", "file_url(true) . "">Click Here");
$linkArray[3] = array("Thumbnail:", "file_url(true) . "">
thumb_url(true) . "">");
- $linkArray[4] = array("Embed:", "");
- $linkTitles[1] = array("Link To The Video File:", 3);
+
+ // Figure out what the path of the .flv file is.
+ $str_movie_path = $item->file_url(true);
+ if (module::is_active("videos")) {
+ $items_video = ORM::factory("items_video")
+ ->where("item_id", "=", $item->id)
+ ->find();
+ if ($items_video->loaded()) {
+ if (file_exists($item->resize_path() . ".flv")) {
+ $str_movie_path = str_replace("?m=", ".flv?m=", $item->resize_url(true));
+ } else {
+ $str_movie_path = "";
+ }
+ }
+ }
+
+ if ($str_movie_path != "") {
+ $linkArray[4] = array("Embed:", "");
+ $linkTitles[1] = array("Link To The Video File:", 3);
+ } else {
+ $linkTitles[1] = array("Link To The Video File:", 2);
+ }
}
// Or else assume the item is a photo.
diff --git a/3.0/modules/embedlinks/views/embedlinks_photo_block.html.php b/3.0/modules/embedlinks/views/embedlinks_photo_block.html.php
index ab26eb93..19d67596 100644
--- a/3.0/modules/embedlinks/views/embedlinks_photo_block.html.php
+++ b/3.0/modules/embedlinks/views/embedlinks_photo_block.html.php
@@ -57,10 +57,27 @@ input[type="text"] {
} ?>
if ($item->is_movie()) { ?>
-
- = t("Embed:") ?> |
- " type="application/x-shockwave-flash">" />" onclick="this.focus(); this.select();" readonly> |
-
+
+ $str_movie_path = $item->file_url(true);
+ if (module::is_active("videos")) {
+ $items_video = ORM::factory("items_video")
+ ->where("item_id", "=", $item->id)
+ ->find();
+ if ($items_video->loaded()) {
+ if (file_exists($item->resize_path() . ".flv")) {
+ $str_movie_path = str_replace("?m=", ".flv?m=", $item->resize_url(true));
+ } else {
+ $str_movie_path = "";
+ }
+ }
+ }
+ ?>
+ if ($str_movie_path != "") { ?>
+
+ = t("Embed:") ?> |
+ " /> |
+
+ } ?>
} ?>
} ?>
diff --git a/3.1/modules/embedlinks/controllers/embedlinks.php b/3.1/modules/embedlinks/controllers/embedlinks.php
index 2ff53b1a..5a7b70cb 100644
--- a/3.1/modules/embedlinks/controllers/embedlinks.php
+++ b/3.1/modules/embedlinks/controllers/embedlinks.php
@@ -50,8 +50,33 @@ class EmbedLinks_Controller extends Controller {
if (access::can("view_full", $item)) {
$linkArray[2] = array("Text:", "file_url(true) . "">Click Here");
$linkArray[3] = array("Thumbnail:", "file_url(true) . "">
thumb_url(true) . "">");
- $linkArray[4] = array("Embed:", "");
- $linkTitles[1] = array("Link To The Video File:", 3);
+
+ // Figure out what the path of the .flv file is.
+ $str_movie_path = $item->file_url(true);
+ if (module::is_active("videos")) {
+ $items_video = ORM::factory("items_video")
+ ->where("item_id", "=", $item->id)
+ ->find();
+ if ($items_video->loaded()) {
+ if (file_exists($item->resize_path() . ".flv")) {
+ $str_movie_path = str_replace("?m=", ".flv?m=", $item->resize_url(true));
+ } else {
+ $str_movie_path = "";
+ }
+ }
+ }
+
+ if ($str_movie_path != "") {
+ $linkArray[4] = array("Embed:", "");
+ $linkTitles[1] = array("Link To The Video File:", 3);
+ } else {
+ $linkTitles[1] = array("Link To The Video File:", 2);
+ }
}
// Or else assume the item is a photo.
diff --git a/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php b/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php
index ab26eb93..19d67596 100644
--- a/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php
+++ b/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php
@@ -57,10 +57,27 @@ input[type="text"] {
} ?>
if ($item->is_movie()) { ?>
-
- = t("Embed:") ?> |
- " type="application/x-shockwave-flash">" />" onclick="this.focus(); this.select();" readonly> |
-
+
+ $str_movie_path = $item->file_url(true);
+ if (module::is_active("videos")) {
+ $items_video = ORM::factory("items_video")
+ ->where("item_id", "=", $item->id)
+ ->find();
+ if ($items_video->loaded()) {
+ if (file_exists($item->resize_path() . ".flv")) {
+ $str_movie_path = str_replace("?m=", ".flv?m=", $item->resize_url(true));
+ } else {
+ $str_movie_path = "";
+ }
+ }
+ }
+ ?>
+ if ($str_movie_path != "") { ?>
+
+ = t("Embed:") ?> |
+ " /> |
+
+ } ?>
} ?>
} ?>