Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added category view for SEO

  • Loading branch information...
commit dac8785e2ef9f72a63c3c16176c579306d76b6ca 1 parent 16ea090
puneet-izap puneet-izap authored
31 actions/logged_in/add_edit.php 100644 → 100755
... ... @@ -1,4 +1,5 @@
1 1 <?php
  2 +
2 3 /**
3 4 * iZAP izap_videos
4 5 *
@@ -15,9 +16,9 @@
15 16 /**
16 17 * check for form error
17 18 */
18   -if(IzapBase::hasFormError()) {
19   - if(sizeof(IzapBase::getFormErrors())) {
20   - foreach(IzapBase::getFormErrors() as $error) {
  19 +if (IzapBase::hasFormError()) {
  20 + if (sizeof(IzapBase::getFormErrors())) {
  21 + foreach (IzapBase::getFormErrors() as $error) {
21 22 register_error($error);
22 23 }
23 24 }
@@ -26,21 +27,21 @@
26 27 }
27 28
28 29 IzapBase::loadLib(array(
29   - 'plugin' => GLOBAL_IZAP_VIDEOS_PLUGIN,
30   - 'lib' => 'izap_videos_lib',
  30 + 'plugin' => GLOBAL_IZAP_VIDEOS_PLUGIN,
  31 + 'lib' => 'izap_videos_lib',
31 32 ));
32 33
33 34 $posted_array = IzapBase::getPostedAttributes();
34   -$izap_videos = new IzapVideos((int)$posted_array['guid']);
  35 +$izap_videos = new IzapVideos((int) $posted_array['guid']);
35 36 IzapBase::updatePostedAttribute('tags', string_to_tag_array($posted_array['tags']));
36 37 IzapBase::updatePostedAttribute('video_views', 1);
37 38 $izap_videos->setAttributes();
38 39
39   -if($izap_videos->isNewRecord()){ // only include for adding video
  40 +if ($izap_videos->isNewRecord()) { // only include for adding video
40 41 switch ($izap_videos->videoprocess) {
41 42 case 'offserver':
42   - // if url is not valid then send it back
43   - if(!filter_var($izap_videos->videourl, FILTER_VALIDATE_URL)) {
  43 + // if url is not valid then send it back
  44 + if (!filter_var($izap_videos->videourl, FILTER_VALIDATE_URL)) {
44 45 register_error(elgg_echo('izap_videos:error:notValidUrl'));
45 46 forward(REFERRER);
46 47 exit;
@@ -55,29 +56,29 @@
55 56 }
56 57
57 58 // if we have the optional image then replace all the previous values
58   -if($_FILES['attributes']['error']['videoimage'] == 0 && in_array(strtolower(end(explode('.', $_FILES['attributes']['name']['videoimage']))), array('jpg', 'gif', 'jpeg', 'png'))) {
59   -
  59 +if ($_FILES['attributes']['error']['videoimage'] == 0 && in_array(strtolower(end(explode('.', $_FILES['attributes']['name']['videoimage']))), array('jpg', 'gif', 'jpeg', 'png'))) {
  60 +
60 61 $izap_videos->setFilename($izap_videos->orignal_thumb);
61 62 $izap_videos->open("write");
62 63 $izap_videos->write(file_get_contents($_FILES['attributes']['tmp_name']['videoimage']));
63 64
64   - $thumb = get_resized_image_from_existing_file($izap_videos->getFilenameOnFilestore(),120,90, true);
  65 + $thumb = get_resized_image_from_existing_file($izap_videos->getFilenameOnFilestore(), 120, 90, true);
65 66
66 67 $izap_videos->setFilename($izap_videos->imagesrc);
67 68 $izap_videos->open("write");
68 69 $izap_videos->write($thumb);
69 70 }
70 71
71   -if(!$izap_videos->save()) {
  72 +if (!$izap_videos->save()) {
72 73 register_error(elgg_echo('izap_videos:error:save'));
73 74 forward(REFERRER);
74 75 exit;
75 76 }
76 77
77 78 // save the file info for converting it later in queue
78   -if($izap_videos->videoprocess == 'onserver' && !$izap_videos->isNewRecord()) {
  79 +if ($izap_videos->videoprocess == 'onserver' && !$izap_videos->isNewRecord()) {
79 80 $izap_videos->videosrc = $CONFIG->wwwroot . 'izap_videos_files/file/' . $izap_videos->guid . '/' . friendly_title($izap_videos->title) . '.flv';
80   - if(IzapBase::getFileExtension($tmpUploadedFile) != 'flv') { // will only send to queue if it is not flv
  81 + if (IzapBase::getFileExtension($tmpUploadedFile) != 'flv') { // will only send to queue if it is not flv
81 82 izapSaveFileInfoForConverting_izap_videos($tmpUploadedFile, $izap_videos, $izap_videos->access_id);
82 83 }
83 84 }
0  actions/logged_in/offserver.php 100644 → 100755
File mode changed
8 classes/IzapVideos.php 100644 → 100755
@@ -255,6 +255,14 @@ public function getOrignalThumb() {
255 255 return $IZAPSETTINGS->filesPath . 'image/' . $this->guid . '/orignal/' . elgg_get_friendly_title($this->title) . '.jpg';
256 256 }
257 257
  258 + /**
  259 + * displays the recently added or edited thumbnail of videos in the site's activity page
  260 + *
  261 + * @global type $IZAPSETTINGS
  262 + * @param type $width
  263 + * @param type $height
  264 + * @return string
  265 + */
258 266 public function getAjaxedThumb($width = 250, $height = 200) {
259 267 global $IZAPSETTINGS;
260 268 $unique = md5($this->guid . '-' . $width . '-' . $height);
6 classes/izapQueue.php 100644 → 100755
@@ -135,6 +135,12 @@ public function delete($guid = false, $also_media = false) {
135 135 return $this->execute((($guid) ? "DELETE FROM video_queue WHERE guid = {$guid}" : 'DELETE FROM video_queue'));
136 136 }
137 137
  138 + /**
  139 + *
  140 + * @param type $guid
  141 + * @param type $also_media
  142 + * @return type
  143 + */
138 144 public function delete_from_trash($guid = false, $also_media = false) {
139 145 $queue_db = $this->db_connection;
140 146 if ($also_media) {
0  languages/en.php 100644 → 100755
File mode changed
6 lib/izap_videos_lib.php 100644 → 100755
@@ -741,9 +741,9 @@ function izapGetFriendlyFileName_izap_videos($fileName) {
741 741
742 742 /**
743 743 * this function checks the supported videos
744   - * @global <type> $CONFIG
745   - * @param string $videoFileName video name with extension
746   - * @return boolean TRUE if supported else FALSE
  744 + * @global <type> $CONFIG
  745 + * @param string $videoFileName video name with extension
  746 + * @return boolean TRUE if supported else FALSE
747 747 */
748 748 function izapSupportedVideos_izap_videos($videoFileName) {
749 749 global $IZAPSETTINGS;
0  start.php 100644 → 100755
File mode changed
1  views/default/forms/izap-videos/_partial.php 100644 → 100755
@@ -116,6 +116,7 @@
116 116
117 117
118 118 $form .= elgg_view('input/izap_categories', array('name' => 'attributes[categories]','plugin_id' => GLOBAL_IZAP_VIDEOS_PLUGIN, 'value' => $video->categories));
  119 +$form .= elgg_view('input/categories', $vars);
119 120
120 121 $form .= elgg_view('input/submit', array(
121 122 'value' => elgg_echo('izap_videos:addEditForm:save'),
0  views/default/forms/izap-videos/tabs.php 100644 → 100755
File mode changed
2  views/default/plugins/izap-videos/settings.php
@@ -11,6 +11,8 @@
11 11 * For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
12 12 * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
13 13 */
  14 +
  15 +// this page displays the plugin settings content in the admin control panel
14 16 IzapBase::loadLib(array(
15 17 'plugin' => GLOBAL_IZAP_VIDEOS_PLUGIN,
16 18 'lib' => 'izap_videos_lib'
38 views/default/river/object/izap_videos/default.php 100644 → 100755
... ... @@ -1,31 +1,33 @@
1 1 <?php
2   -/**************************************************
3   -* PluginLotto.com *
4   -* Copyrights (c) 2005-2010. iZAP *
5   -* All rights reserved *
6   -***************************************************
7   -* @author iZAP Team "<support@izap.in>"
8   -* @link http://www.izap.in/
9   -* Under this agreement, No one has rights to sell this script further.
10   -* For more information. Contact "Tarun Jangra<tarun@izap.in>"
11   -* For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
12   -* Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
  2 +
  3 +/* * ************************************************
  4 + * PluginLotto.com *
  5 + * Copyrights (c) 2005-2010. iZAP *
  6 + * All rights reserved *
  7 + * **************************************************
  8 + * @author iZAP Team "<support@izap.in>"
  9 + * @link http://www.izap.in/
  10 + * Under this agreement, No one has rights to sell this script further.
  11 + * For more information. Contact "Tarun Jangra<tarun@izap.in>"
  12 + * For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
  13 + * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
13 14 */
14 15
  16 +//this page displays the list of videos in the site's home page
  17 +//home page can be understood as the activity page in the site
15 18 $object = $vars['item']->getObjectEntity();
16 19 $contents = strip_tags($object->description);
17 20 $string .= $object->getAjaxedThumb();
18   -if(strlen($contents) > 200) {
  21 +if (strlen($contents) > 200) {
19 22 $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
20   -}else {
  23 +} else {
21 24 $string .= $contents;
22 25 }
23 26 ?>
24 27
25   -<?php
26   -$description = '<div class="izap-river">'.$string.'</div><div class="clearfloat"></div>';
27   -
  28 +<?php // here the list of uploaded videos is being displayed
  29 +$description = '<div class="izap-river">' . $string . '</div><div class="clearfloat"></div>';
28 30 echo elgg_view('river/item', array(
29   - 'item' => $vars['item'],
30   - 'message' => $description,
  31 + 'item' => $vars['item'],
  32 + 'message' => $description,
31 33 ));

0 comments on commit dac8785

Please sign in to comment.
Something went wrong with that request. Please try again.