Manu_youtbue_video_upload - Version 1.1.3

Version Notes

Video upload extension allow to video. video Gallery allow to play your youtube video gallery on your website

Download this release

Release Info

Developer Manvendra Sharma
Extension Manu_youtbue_video_upload
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.3

app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Manv_Youtbue_Block_Adminhtml_Youtbue extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ $this->_controller = "adminhtml_youtbue";
10
+ $this->_blockGroup = "youtbue";
11
+ $this->_headerText = Mage::helper("youtbue")->__("Youtbue Manager");
12
+ $this->_addButtonLabel = Mage::helper("youtbue")->__("Add New Item");
13
+ parent::__construct();
14
+
15
+ }
16
+
17
+ }
app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue/Edit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Manv_Youtbue_Block_Adminhtml_Youtbue_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+
8
+ parent::__construct();
9
+ $this->_objectId = "id";
10
+ $this->_blockGroup = "youtbue";
11
+ $this->_controller = "adminhtml_youtbue";
12
+ $this->_updateButton("save", "label", Mage::helper("youtbue")->__("Save Item"));
13
+ $this->_updateButton("delete", "label", Mage::helper("youtbue")->__("Delete Item"));
14
+
15
+ $this->_addButton("saveandcontinue", array(
16
+ "label" => Mage::helper("youtbue")->__("Save And Continue Edit"),
17
+ "onclick" => "saveAndContinueEdit()",
18
+ "class" => "save",
19
+ ), -100);
20
+
21
+
22
+
23
+ $this->_formScripts[] = "
24
+
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ ";
29
+ }
30
+
31
+ public function getHeaderText()
32
+ {
33
+ if( Mage::registry("youtbue_data") && Mage::registry("youtbue_data")->getId() ){
34
+
35
+ return Mage::helper("youtbue")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("youtbue_data")->getId()));
36
+
37
+ }
38
+ else{
39
+
40
+ return Mage::helper("youtbue")->__("Add Item");
41
+
42
+ }
43
+ }
44
+ }
app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Block_Adminhtml_Youtbue_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ "id" => "edit_form",
8
+ "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
9
+ "method" => "post",
10
+ "enctype" =>"multipart/form-data",
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue/Edit/Tab/Form.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Block_Adminhtml_Youtbue_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset("youtbue_form", array("legend"=>Mage::helper("youtbue")->__("Item information")));
10
+
11
+
12
+ $fieldset->addField("title", "text", array(
13
+ "label" => Mage::helper("youtbue")->__("Title"),
14
+ "name" => "title",
15
+ ));
16
+
17
+ $fieldset->addField("url", "text", array(
18
+ "label" => Mage::helper("youtbue")->__("Video URL"),
19
+ "name" => "url",
20
+ ));
21
+
22
+ $fieldset->addField("description", "textarea", array(
23
+ "label" => Mage::helper("youtbue")->__("Description"),
24
+ "name" => "description",
25
+ ));
26
+
27
+ $fieldset->addField('status', 'select', array(
28
+ 'label' => Mage::helper('youtbue')->__('Status'),
29
+ 'values' => Manv_Youtbue_Block_Adminhtml_Youtbue_Grid::getValueArray3(),
30
+ 'name' => 'status',
31
+ ));
32
+
33
+ if (Mage::getSingleton("adminhtml/session")->getYoutbueData())
34
+ {
35
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getYoutbueData());
36
+ Mage::getSingleton("adminhtml/session")->setYoutbueData(null);
37
+ }
38
+ elseif(Mage::registry("youtbue_data")) {
39
+ $form->setValues(Mage::registry("youtbue_data")->getData());
40
+ }
41
+ return parent::_prepareForm();
42
+ }
43
+ }
app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue/Edit/Tabs.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Block_Adminhtml_Youtbue_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId("youtbue_tabs");
8
+ $this->setDestElementId("edit_form");
9
+ $this->setTitle(Mage::helper("youtbue")->__("Item Information"));
10
+ }
11
+ protected function _beforeToHtml()
12
+ {
13
+ $this->addTab("form_section", array(
14
+ "label" => Mage::helper("youtbue")->__("Item Information"),
15
+ "title" => Mage::helper("youtbue")->__("Item Information"),
16
+ "content" => $this->getLayout()->createBlock("youtbue/adminhtml_youtbue_edit_tab_form")->toHtml(),
17
+ ));
18
+ return parent::_beforeToHtml();
19
+ }
20
+
21
+ }
app/code/community/Manv/Youtbue/Block/Adminhtml/Youtbue/Grid.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Manv_Youtbue_Block_Adminhtml_Youtbue_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId("youtbueGrid");
10
+ $this->setDefaultSort("id");
11
+ $this->setDefaultDir("DESC");
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel("youtbue/youtbue")->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn("id", array(
24
+ "header" => Mage::helper("youtbue")->__("ID"),
25
+ "align" =>"right",
26
+ "width" => "50px",
27
+ "type" => "number",
28
+ "index" => "id",
29
+ ));
30
+
31
+ $this->addColumn("title", array(
32
+ "header" => Mage::helper("youtbue")->__("Title"),
33
+ "index" => "title",
34
+ ));
35
+ $this->addColumn("url", array(
36
+ "header" => Mage::helper("youtbue")->__("Video URL"),
37
+ "index" => "url",
38
+ ));
39
+ $this->addColumn('status', array(
40
+ 'header' => Mage::helper('youtbue')->__('Status'),
41
+ 'index' => 'status',
42
+ 'type' => 'options',
43
+ 'options'=>Manv_Youtbue_Block_Adminhtml_Youtbue_Grid::getOptionArray3(),
44
+ ));
45
+
46
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
47
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
48
+
49
+ return parent::_prepareColumns();
50
+ }
51
+
52
+ public function getRowUrl($row)
53
+ {
54
+ return $this->getUrl("*/*/edit", array("id" => $row->getId()));
55
+ }
56
+
57
+
58
+
59
+ protected function _prepareMassaction()
60
+ {
61
+ $this->setMassactionIdField('id');
62
+ $this->getMassactionBlock()->setFormFieldName('ids');
63
+ $this->getMassactionBlock()->setUseSelectAll(true);
64
+ $this->getMassactionBlock()->addItem('remove_youtbue', array(
65
+ 'label'=> Mage::helper('youtbue')->__('Remove Youtbue'),
66
+ 'url' => $this->getUrl('*/adminhtml_youtbue/massRemove'),
67
+ 'confirm' => Mage::helper('youtbue')->__('Are you sure?')
68
+ ));
69
+ return $this;
70
+ }
71
+
72
+ static public function getOptionArray3()
73
+ {
74
+ $data_array=array();
75
+ $data_array[0]='Enable';
76
+ $data_array[1]='Disable';
77
+ return($data_array);
78
+ }
79
+ static public function getValueArray3()
80
+ {
81
+ $data_array=array();
82
+ foreach(Manv_Youtbue_Block_Adminhtml_Youtbue_Grid::getOptionArray3() as $k=>$v){
83
+ $data_array[]=array('value'=>$k,'label'=>$v);
84
+ }
85
+ return($data_array);
86
+
87
+ }
88
+
89
+
90
+ }
app/code/community/Manv/Youtbue/Block/Index.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Block_Index extends Mage_Core_Block_Template{
3
+
4
+
5
+ public function getYoutbuevideouploadEnabled()
6
+ {
7
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/status',Mage::app()->getStore());
8
+ }
9
+ public function getYoutbuevideouploadimageheight()
10
+ {
11
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/imageheight',Mage::app()->getStore());
12
+ }
13
+
14
+ public function getYoutbuevideouploadimagewidth()
15
+ {
16
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/imagewidht',Mage::app()->getStore());
17
+ }
18
+
19
+ public function getYoutbuevideouploadvideohight()
20
+ {
21
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/videoheight',Mage::app()->getStore());
22
+ }
23
+
24
+ public function getYoutbuevideouploadvideowidth()
25
+ {
26
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/videowidth',Mage::app()->getStore());
27
+ }
28
+
29
+ public function getYoutbuevideouploadonerowitem()
30
+ {
31
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/numbofiteninrow',Mage::app()->getStore());
32
+ }
33
+
34
+ public function getYoutbuevideouploadproductsperpage()
35
+ {
36
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/numofiteminpage',Mage::app()->getStore());
37
+ }
38
+
39
+
40
+ public function getYoutbuevideouploadautoplay()
41
+ {
42
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/autoplay',Mage::app()->getStore());
43
+ }
44
+
45
+ public function getYoutbuevideouploadpopupspeed()
46
+ {
47
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/popupspeed',Mage::app()->getStore());
48
+ }
49
+ public function getYoutbuevideouploaddescription()
50
+ {
51
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/description',Mage::app()->getStore());
52
+ }
53
+ public function getYoutbuevideouploadpagination()
54
+ {
55
+ return Mage::getStoreConfig('manvvideogallerysection/manvvideogallerygroup/pagination',Mage::app()->getStore());
56
+ }
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+ }
app/code/community/Manv/Youtbue/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Manv/Youtbue/Model/Mysql4/Youtbue.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Model_Mysql4_Youtbue extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("youtbue/youtbue", "id");
7
+ }
8
+ }
app/code/community/Manv/Youtbue/Model/Mysql4/Youtbue/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_Model_Mysql4_Youtbue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("youtbue/youtbue");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Manv/Youtbue/Model/Youtbue.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Manv_Youtbue_Model_Youtbue extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("youtbue/youtbue");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Manv/Youtbue/controllers/Adminhtml/YoutbueController.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Manv_Youtbue_Adminhtml_YoutbueController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected function _initAction()
6
+ {
7
+ $this->loadLayout()->_setActiveMenu("youtbue/youtbue")->_addBreadcrumb(Mage::helper("adminhtml")->__("Youtbue Manager"),Mage::helper("adminhtml")->__("Youtbue Manager"));
8
+ return $this;
9
+ }
10
+ public function indexAction()
11
+ {
12
+ $this->_title($this->__("Youtbue"));
13
+ $this->_title($this->__("Manager Youtbue"));
14
+
15
+ $this->_initAction();
16
+ $this->renderLayout();
17
+ }
18
+ public function editAction()
19
+ {
20
+ $this->_title($this->__("Youtbue"));
21
+ $this->_title($this->__("Youtbue"));
22
+ $this->_title($this->__("Edit Item"));
23
+
24
+ $id = $this->getRequest()->getParam("id");
25
+ $model = Mage::getModel("youtbue/youtbue")->load($id);
26
+ if ($model->getId()) {
27
+ Mage::register("youtbue_data", $model);
28
+ $this->loadLayout();
29
+ $this->_setActiveMenu("youtbue/youtbue");
30
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Youtbue Manager"), Mage::helper("adminhtml")->__("Youtbue Manager"));
31
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Youtbue Description"), Mage::helper("adminhtml")->__("Youtbue Description"));
32
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
33
+ $this->_addContent($this->getLayout()->createBlock("youtbue/adminhtml_youtbue_edit"))->_addLeft($this->getLayout()->createBlock("youtbue/adminhtml_youtbue_edit_tabs"));
34
+ $this->renderLayout();
35
+ }
36
+ else {
37
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("youtbue")->__("Item does not exist."));
38
+ $this->_redirect("*/*/");
39
+ }
40
+ }
41
+
42
+ public function newAction()
43
+ {
44
+
45
+ $this->_title($this->__("Youtbue"));
46
+ $this->_title($this->__("Youtbue"));
47
+ $this->_title($this->__("New Item"));
48
+
49
+ $id = $this->getRequest()->getParam("id");
50
+ $model = Mage::getModel("youtbue/youtbue")->load($id);
51
+
52
+ $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
53
+ if (!empty($data)) {
54
+ $model->setData($data);
55
+ }
56
+
57
+ Mage::register("youtbue_data", $model);
58
+
59
+ $this->loadLayout();
60
+ $this->_setActiveMenu("youtbue/youtbue");
61
+
62
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
63
+
64
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Youtbue Manager"), Mage::helper("adminhtml")->__("Youtbue Manager"));
65
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Youtbue Description"), Mage::helper("adminhtml")->__("Youtbue Description"));
66
+
67
+
68
+ $this->_addContent($this->getLayout()->createBlock("youtbue/adminhtml_youtbue_edit"))->_addLeft($this->getLayout()->createBlock("youtbue/adminhtml_youtbue_edit_tabs"));
69
+
70
+ $this->renderLayout();
71
+
72
+ }
73
+ public function saveAction()
74
+ {
75
+
76
+ $post_data=$this->getRequest()->getPost();
77
+
78
+
79
+ if ($post_data) {
80
+
81
+ try {
82
+
83
+
84
+
85
+ $model = Mage::getModel("youtbue/youtbue")
86
+ ->addData($post_data)
87
+ ->setId($this->getRequest()->getParam("id"))
88
+ ->save();
89
+
90
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Youtbue was successfully saved"));
91
+ Mage::getSingleton("adminhtml/session")->setYoutbueData(false);
92
+
93
+ if ($this->getRequest()->getParam("back")) {
94
+ $this->_redirect("*/*/edit", array("id" => $model->getId()));
95
+ return;
96
+ }
97
+ $this->_redirect("*/*/");
98
+ return;
99
+ }
100
+ catch (Exception $e) {
101
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
102
+ Mage::getSingleton("adminhtml/session")->setYoutbueData($this->getRequest()->getPost());
103
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
104
+ return;
105
+ }
106
+
107
+ }
108
+ $this->_redirect("*/*/");
109
+ }
110
+
111
+
112
+
113
+ public function deleteAction()
114
+ {
115
+ if( $this->getRequest()->getParam("id") > 0 ) {
116
+ try {
117
+ $model = Mage::getModel("youtbue/youtbue");
118
+ $model->setId($this->getRequest()->getParam("id"))->delete();
119
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
120
+ $this->_redirect("*/*/");
121
+ }
122
+ catch (Exception $e) {
123
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
124
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
125
+ }
126
+ }
127
+ $this->_redirect("*/*/");
128
+ }
129
+
130
+
131
+ public function massRemoveAction()
132
+ {
133
+ try {
134
+ $ids = $this->getRequest()->getPost('ids', array());
135
+ foreach ($ids as $id) {
136
+ $model = Mage::getModel("youtbue/youtbue");
137
+ $model->setId($id)->delete();
138
+ }
139
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
140
+ }
141
+ catch (Exception $e) {
142
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
143
+ }
144
+ $this->_redirect('*/*/');
145
+ }
146
+
147
+ /**
148
+ * Export order grid to CSV format
149
+ */
150
+ public function exportCsvAction()
151
+ {
152
+ $fileName = 'youtbue.csv';
153
+ $grid = $this->getLayout()->createBlock('youtbue/adminhtml_youtbue_grid');
154
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
155
+ }
156
+ /**
157
+ * Export order grid to Excel XML format
158
+ */
159
+ public function exportExcelAction()
160
+ {
161
+ $fileName = 'youtbue.xml';
162
+ $grid = $this->getLayout()->createBlock('youtbue/adminhtml_youtbue_grid');
163
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
164
+ }
165
+ }
app/code/community/Manv/Youtbue/controllers/IndexController.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Manv_Youtbue_IndexController extends Mage_Core_Controller_Front_Action{
3
+ public function IndexAction() {
4
+
5
+ $this->loadLayout();
6
+ $this->getLayout()->getBlock("head")->setTitle($this->__("Video Gallery"));
7
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
8
+ $breadcrumbs->addCrumb("home", array(
9
+ "label" => $this->__("Home Page"),
10
+ "title" => $this->__("Home Page"),
11
+ "link" => Mage::getBaseUrl()
12
+ ));
13
+
14
+ $breadcrumbs->addCrumb("video gallery", array(
15
+ "label" => $this->__("Video Gallery"),
16
+ "title" => $this->__("Video Gallery")
17
+ ));
18
+
19
+ $this->renderLayout();
20
+
21
+ }
22
+ }
app/code/community/Manv/Youtbue/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <manvvideogallerysection translate="title" module="youtbue">
12
+ <title>General Setting Section</title>
13
+ <sort_order>0</sort_order>
14
+ </manvvideogallerysection>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Manv/Youtbue/etc/config.xml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Manv_Youtbue>
5
+ <version>1.1.3</version>
6
+ </Manv_Youtbue>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <youtbue>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Manv_Youtbue</module>
14
+ <frontName>youtbue</frontName>
15
+ </args>
16
+ </youtbue>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <youtbue>
21
+ <file>youtbue.xml</file>
22
+ </youtbue>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <youtbue>
29
+ <class>Manv_Youtbue_Helper</class>
30
+ </youtbue>
31
+ </helpers>
32
+ <blocks>
33
+ <youtbue>
34
+ <class>Manv_Youtbue_Block</class>
35
+ </youtbue>
36
+ </blocks>
37
+ <models>
38
+ <youtbue>
39
+ <class>Manv_Youtbue_Model</class>
40
+ <resourceModel>youtbue_mysql4</resourceModel>
41
+ </youtbue>
42
+ <youtbue_mysql4>
43
+ <class>Manv_Youtbue_Model_Mysql4</class>
44
+ <entities>
45
+ <youtbue>
46
+ <table>manvvideogallery</table>
47
+ </youtbue>
48
+ </entities>
49
+ </youtbue_mysql4>
50
+ </models>
51
+ <resources>
52
+ <youtbue_setup>
53
+ <setup>
54
+ <module>Manv_Youtbue</module>
55
+ </setup>
56
+ <connection>
57
+ <use>core_setup</use>
58
+ </connection>
59
+ </youtbue_setup>
60
+ <youtbue_write>
61
+ <connection>
62
+ <use>core_write</use>
63
+ </connection>
64
+ </youtbue_write>
65
+ <youtbue_read>
66
+ <connection>
67
+ <use>core_read</use>
68
+ </connection>
69
+ </youtbue_read>
70
+ </resources>
71
+ </global>
72
+ <admin>
73
+ <routers>
74
+ <youtbue>
75
+ <use>admin</use>
76
+ <args>
77
+ <module>Manv_Youtbue</module>
78
+ <frontName>youtbue</frontName>
79
+ </args>
80
+ </youtbue>
81
+ </routers>
82
+ </admin>
83
+ <adminhtml>
84
+ <menu>
85
+ <youtbue module="youtbue">
86
+ <title>Youtbue</title>
87
+ <sort_order>100</sort_order>
88
+ <children>
89
+ <youtbue module="youtbue">
90
+ <title>Manage Youtbue</title>
91
+ <sort_order>0</sort_order>
92
+ <action>youtbue/adminhtml_youtbue</action>
93
+ </youtbue>
94
+ </children>
95
+ </youtbue>
96
+ </menu>
97
+ <acl>
98
+ <resources>
99
+ <all>
100
+ <title>Allow Everything</title>
101
+ </all>
102
+ <admin>
103
+ <children>
104
+ <youtbue translate="title" module="youtbue">
105
+ <title>Youtbue</title>
106
+ <sort_order>1000</sort_order>
107
+ <children>
108
+ <youtbue translate="title">
109
+ <title>Manage Youtbue</title>
110
+ <sort_order>0</sort_order>
111
+ </youtbue>
112
+ </children>
113
+ </youtbue>
114
+ </children>
115
+ </admin>
116
+ </resources>
117
+ </acl>
118
+ <layout>
119
+ <updates>
120
+ <youtbue>
121
+ <file>youtbue.xml</file>
122
+ </youtbue>
123
+ </updates>
124
+ </layout>
125
+ </adminhtml>
126
+ </config>
app/code/community/Manv/Youtbue/etc/system.xml ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <manvvideogallery translate="label" module="youtbue">
5
+ <label>Manv_Video Gallery</label>
6
+ <sort_order>0</sort_order>
7
+ </manvvideogallery>
8
+ </tabs>
9
+ <sections>
10
+ <manvvideogallerysection translate="label" module="youtbue">
11
+ <label>General Setting</label>
12
+ <tab>manvvideogallery</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>0</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <manvvideogallerygroup translate="label">
20
+ <label>General Setting</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <status translate="label">
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>0</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </status>
36
+ <numbofiteninrow translate="label">
37
+ <label>Number of Item In a Row</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>0</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <comment>Exaple: 3,4,5....</comment>
44
+ </numbofiteninrow>
45
+ <numofiteminpage translate="label">
46
+ <label>Number of Item In a Page</label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>0</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ <comment>Example: 10,15,...</comment>
53
+ </numofiteminpage>
54
+ <imageheight translate="label">
55
+ <label>Image Height</label>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>0</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ <comment>Example: 150,200,....</comment>
62
+ </imageheight>
63
+ <imagewidht translate="label">
64
+ <label>Image Width</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>0</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ <comment>Example: 150,200,....</comment>
71
+ </imagewidht>
72
+ <videoheight translate="label">
73
+ <label>Video Height</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>0</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <comment>Example: 500,550,....</comment>
80
+ </videoheight>
81
+ <videowidth translate="label">
82
+ <label>Video Width</label>
83
+ <frontend_type>text</frontend_type>
84
+ <sort_order>0</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>1</show_in_store>
88
+ <comment>Example: 500,550,....</comment>
89
+ </videowidth>
90
+ <pagination translate="label">
91
+ <label>Pagination</label>
92
+ <frontend_type>select</frontend_type>
93
+ <source_model>adminhtml/system_config_source_yesno</source_model>
94
+ <sort_order>3</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ </pagination>
99
+ <description translate="label">
100
+ <label>Description</label>
101
+ <frontend_type>select</frontend_type>
102
+ <source_model>adminhtml/system_config_source_yesno</source_model>
103
+ <sort_order>1</sort_order>
104
+ <show_in_default>1</show_in_default>
105
+ <show_in_website>1</show_in_website>
106
+ <show_in_store>1</show_in_store>
107
+ </description>
108
+ <autoplay translate="label">
109
+ <label>Auto Play</label>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>adminhtml/system_config_source_yesno</source_model>
112
+ <sort_order>2</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </autoplay>
117
+ <popupspeed translate="label">
118
+ <label>Popup speed </label>
119
+ <frontend_type>text</frontend_type>
120
+ <sort_order>10</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>1</show_in_store>
124
+ <comment>Example :- 1000,1500,2000</comment>
125
+ </popupspeed>
126
+ </fields>
127
+ </manvvideogallerygroup>
128
+ </groups>
129
+ </manvvideogallerysection>
130
+ </sections>
131
+ </config>
app/code/community/Manv/Youtbue/sql/youtbue_setup/mysql4-install-1.1.3.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $sql=<<<SQLTEXT
5
+ create table {$this->getTable('manvvideogallery')} (id int not null auto_increment, title varchar(255), url varchar(255),description varchar(255),status varchar(255),primary key(id));
6
+
7
+ insert into {$this->getTable('manvvideogallery')} (`title`,`url`,`description`,`status`) VALUES
8
+ ('Youtube Video gallery 1','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
9
+ ('Youtube Video gallery 2','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
10
+ ('Youtube Video gallery 3','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
11
+ ('Youtube Video gallery 4','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
12
+ ('Youtube Video gallery 5','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
13
+ ('Youtube Video gallery 6','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
14
+ ('Youtube Video gallery 7','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
15
+ ('Youtube Video gallery 8','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
16
+ ('Youtube Video gallery 9','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
17
+ ('Youtube Video gallery 10','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
18
+ ('Youtube Video gallery 11','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
19
+ ('Youtube Video gallery 12','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
20
+ ('Youtube Video gallery 13','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
21
+ ('Youtube Video gallery 14','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
22
+ ('Youtube Video gallery 15','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
23
+ ('Youtube Video gallery 16','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
24
+ ('Youtube Video gallery 17','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
25
+ ('Youtube Video gallery 18','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0'),
26
+ ('Youtube Video gallery 19','https://www.youtube.com/watch?v=dnzLxT8TCvA','www.google.com','0'),
27
+ ('Youtube Video gallery 20','https://www.youtube.com/watch?v=x8F5dz8kv1w','www.google.com','0'),
28
+ ('Youtube Video gallery 21','https://www.youtube.com/watch?v=XNMMrbHMiNM','www.google.com','0');
29
+
30
+ SQLTEXT;
31
+
32
+ $installer->run($sql);
33
+ //demo
34
+ Mage::getModel('core/url_rewrite')->setId(null);
35
+ //demo
36
+ $installer->endSetup();
37
+
app/design/adminhtml/default/default/layout/youtbue.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <youtbue_adminhtml_youtbue_index>
4
+ <reference name="content">
5
+ <block type="youtbue/adminhtml_youtbue" name="youtbue" />
6
+ </reference>
7
+ </youtbue_adminhtml_youtbue_index>
8
+ </layout>
app/design/frontend/base/default/layout/youtbue.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="1.1.3">
3
+ <youtbue_index_index>
4
+ <reference name="root">
5
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
6
+ </reference>
7
+ <reference name="content">
8
+ <block type="youtbue/index" name="youtbue_index" template="youtbue/index.phtml"/>
9
+ </reference>
10
+ </youtbue_index_index>
11
+ </layout>
12
+
app/design/frontend/base/default/template/youtbue/index.phtml ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Video Gallery
2
+
3
+ <?php $enabled = $this->getYoutbuevideouploadEnabled(); ?>
4
+ <?php $videoimagesheight = $view=$this->getYoutbuevideouploadimageheight(); ?>
5
+ <?php $videoimageswidth = $view=$this->getYoutbuevideouploadimagewidth(); ?>
6
+ <?php $videoheight = $view=$this->getYoutbuevideouploadvideohight(); ?>
7
+ <?php $videowidth = $view=$this->getYoutbuevideouploadvideowidth(); ?>
8
+ <?php $description = $view=$this->getYoutbuevideouploaddescription(); ?>
9
+ <?php $pagination = $view=$this->getYoutbuevideouploadpagination(); ?>
10
+ <?php $onerowitem = $view=$this->getYoutbuevideouploadonerowitem(); ?>
11
+ <?php $productsperpage = $view=$this->getYoutbuevideouploadproductsperpage(); ?>
12
+ <?php $popupspeed = $view=$this->getYoutbuevideouploadpopupspeed(); ?>
13
+
14
+
15
+
16
+
17
+
18
+ <?php
19
+ /* Enable /Disble .................................Start */
20
+ if($enabled==1) { ?>
21
+
22
+ <?php $cssurl = str_replace('index.php/','',$this->getUrl());?>
23
+ <script src="<?php echo $cssurl.'skin/frontend/base/default/youtubegallery/jquery-1.2.6.noConflict.min.js'; ?>" type="text/javascript" ></script>
24
+
25
+
26
+ <script type="text/javascript" src="http://www.youtube.com/player_api"></script>
27
+ <script>
28
+ var player;
29
+ function onYouTubePlayerAPIReady() {
30
+ <?php for($mksxx=1;$mksxx<100;$mksxx++){ ?>
31
+ player<?php echo $mksxx; ?> = new YT.Player('player<?php echo $mksxx; ?>');
32
+ <?php } ?>
33
+ }
34
+ </script>
35
+
36
+ <script type="text/javascript">
37
+
38
+ jqr=jQuery.noConflict();
39
+ function applyto(id) {
40
+ var c= '#mks'+id
41
+ jqr(c).fadeIn(<?php echo $popupspeed; ?>);
42
+ }
43
+
44
+ function applytoprev(x,y) {
45
+ jqr('#mks'+x).hide();
46
+ jqr('#mks'+y).show();
47
+ <?php for($mksxx=1;$mksxx<100;$mksxx++){ ?>
48
+ player<?php echo $mksxx; ?>.stopVideo();
49
+ <?php } ?>
50
+ }
51
+
52
+ function applytonext(x,y) {
53
+ jqr('#mks'+x).hide();
54
+ jqr('#mks'+y).show();
55
+ <?php for($mksxx=1;$mksxx<100;$mksxx++){ ?>
56
+ player<?php echo $mksxx; ?>.stopVideo();
57
+ <?php } ?>
58
+ }
59
+
60
+
61
+ function pclose(x)
62
+ {
63
+ jqr('#mks'+x).hide();
64
+ }
65
+
66
+ </script>
67
+
68
+
69
+
70
+ <style type="text/css">
71
+ .blankdiv{background-color:#000;
72
+ position:fixed;
73
+ z-index: 9001;
74
+ top:0px; height:100%;
75
+ left:0px;
76
+ width:100%; opacity: 0.65;
77
+ filter:alpha(opacity=65);}
78
+
79
+ #popupform{height: 100%;
80
+ left: 0;
81
+ padding: 15px;
82
+ position: fixed;
83
+ top: 0;
84
+ width:97%;
85
+ z-index: 10001;
86
+ }
87
+
88
+ #popupform .applyform{position:relative; overflow:auto;
89
+ background-color:#fff;
90
+ width:<?php echo $videowidth+10; ?>px;
91
+ height:<?php echo $videoheight+10; ?>px; margin:5% auto auto auto;
92
+ z-index: 9002; padding:10px; border:10px solid #7F3814; }
93
+
94
+
95
+ #pclose{
96
+
97
+
98
+ cursor: pointer;
99
+ height: 25px;
100
+ margin: 5% auto -6%;
101
+ position: relative;
102
+ right: -276px;
103
+
104
+ top: 0;
105
+ width: 25px;
106
+ z-index: 9999;}
107
+ </style>
108
+ <?php
109
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
110
+
111
+
112
+ $sql = $connection->query("select * from manvvideogallery");
113
+ $nr = $connection->fetchOne( 'SELECT COUNT(*) AS count FROM manvvideogallery' );
114
+ //$sql = mysql_query("SELECT * FROM imagegallery");
115
+
116
+ //echo $nr = mysql_num_rows($sql); // Get total of Num rows from the database query
117
+ if (isset($_GET['pn'])) { // Get pn from URL vars if it is present
118
+ $pn = preg_replace('#[^0-9]#i', '', $_GET['pn']); // filter everything but numbers for security(new)
119
+
120
+ } else {
121
+ $pn = 1;
122
+ }
123
+
124
+ if($pagination==1) {
125
+ $itemsPerPage = $productsperpage;
126
+ } else { $itemsPerPage = 10000; }
127
+
128
+ $lastPage = ceil($nr / $itemsPerPage);
129
+
130
+ if ($pn < 1) { // If it is less than 1
131
+ $pn = 1; // force if to be 1
132
+ } else if ($pn > $lastPage) { // if it is greater than $lastpage
133
+ $pn = $lastPage; // force it to be $lastpage's value
134
+ }
135
+ // This creates the numbers to click in between the next and back buttons
136
+ // This section is explained well in the video that accompanies this script
137
+ $centerPages = "";
138
+ $sub1 = $pn - 1;
139
+ $sub2 = $pn - 2;
140
+ $add1 = $pn + 1;
141
+ $add2 = $pn + 2;
142
+ if ($pn == 1) {
143
+ $centerPages .= '&nbsp; <span class="pagNumActive">' . $pn . '</span> &nbsp;';
144
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '">' . $add1 . '</a> &nbsp;';
145
+ } else if ($pn == $lastPage) {
146
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '">' . $sub1 . '</a> &nbsp;';
147
+ $centerPages .= '&nbsp; <span class="pagNumActive">' . $pn . '</span> &nbsp;';
148
+ } else if ($pn > 2 && $pn < ($lastPage - 1)) {
149
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub2 . '">' . $sub2 . '</a> &nbsp;';
150
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '">' . $sub1 . '</a> &nbsp;';
151
+ $centerPages .= '&nbsp; <span class="pagNumActive">' . $pn . '</span> &nbsp;';
152
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '">' . $add1 . '</a> &nbsp;';
153
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add2 . '">' . $add2 . '</a> &nbsp;';
154
+ } else if ($pn > 1 && $pn < $lastPage) {
155
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $sub1 . '">' . $sub1 . '</a> &nbsp;';
156
+ $centerPages .= '&nbsp; <span class="pagNumActive">' . $pn . '</span> &nbsp;';
157
+ $centerPages .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '">' . $add1 . '</a> &nbsp;';
158
+ }
159
+ // This line sets the "LIMIT" range... the 2 values we place to choose a range of rows from database in our query
160
+ $limit = 'LIMIT ' .($pn - 1) * $itemsPerPage .',' .$itemsPerPage;
161
+ // Now we are going to run the same query as above but this time add $limit onto the end of the SQL syntax
162
+ // $sql2 is what we will use to fuel our while loop statement below
163
+ //$sql2 = mysql_query("SELECT * from imagegallery ORDER BY imagegallery_id ASC $limit");
164
+ $sql2 = $connection->query("select * from manvvideogallery ORDER BY id ASC $limit");
165
+
166
+ $paginationDisplay = ""; // Initialize the pagination output variable
167
+ // This code runs only if the last page variable is ot equal to 1, if it is only 1 page we require no paginated links to display
168
+ if ($lastPage != "1"){
169
+ // This shows the user what page they are on, and the total number of pages
170
+ $paginationDisplay .= 'Page <strong>' . $pn . '</strong> of ' . $lastPage. '&nbsp; &nbsp; &nbsp; ';
171
+ // If we are not on page 1 we can place the Back button
172
+ if ($pn != 1) {
173
+ $previous = $pn - 1;
174
+ $paginationDisplay .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $previous . '"> Back</a> ';
175
+ }
176
+ // Lay in the clickable numbers display here between the Back and Next links
177
+ $paginationDisplay .= '<span class="paginationNumbers">' . $centerPages . '</span>';
178
+ // If we are not on the very last page we can place the Next button
179
+ if ($pn != $lastPage) {
180
+ $nextPage = $pn + 1;
181
+ $paginationDisplay .= '&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $nextPage . '"> Next</a> ';
182
+ }
183
+ }
184
+ ?>
185
+
186
+
187
+ <div style="margin-left:64px; margin-right:64px;">
188
+ <h2>Total Items: <?php echo $nr; ?></h2>
189
+ </div>
190
+
191
+ <?php if($pagination==1) { ?>
192
+ <div style="margin-left:58px; margin-right:58px; padding:6px; background-color:#FFF; border:#999 1px solid;"><?php echo $paginationDisplay; ?></div>
193
+ <?php } ?>
194
+ <table>
195
+ <tr>
196
+ <?php
197
+ $outputList = '';
198
+ $vz=1;
199
+ while($row1 = $sql2->fetch())
200
+ {
201
+ $id = $row1["id"];
202
+ $urlx = $row1["url"];
203
+ $urlvideo = substr(strstr($urlx, 'watch?v='),8,1000);
204
+ ?>
205
+ <td>
206
+ <div style="margin-left:64px;float:left;">
207
+ <a href="javascript:void(0)" onclick="applyto('<?php echo $vz; ?>')">
208
+ <img src="http://img.youtube.com/vi/<?php echo $urlvideo; ?>/0.jpg" height="<?php echo $videoimagesheight; ?>" width="<?php echo $videoimageswidth; ?>" style="padding:10px;"/>
209
+ </a>
210
+ </div>
211
+
212
+ <div id="mks<?php echo $vz; ?>" style="display:none">
213
+ <div id="popupform">
214
+ <div class="blankdiv"></div>
215
+ <div id="pclose" onclick="player<?php echo $vz; ?>.stopVideo();">
216
+ <img src="<?php echo $cssurl.'skin/frontend/base/default/youtubegallery/close.png'; ?>" onclick="pclose(<?php echo $vz; ?>);"/>
217
+ </div>
218
+ <div class="applyform">
219
+ <p id="contactArea">
220
+ <table class="videopopup">
221
+ <tr>
222
+ <td align="left"><a href="javascript:void(0)" onclick="applytoprev('<?php echo $vz; ?>' ,'<?php echo $vz-1; ?>')"><img src="<?php echo $cssurl.'skin/frontend/base/default/youtubegallery/left_1.png'; ?>" /></a></td>
223
+ <td align="right"><a style="float:right;" href="javascript:void(0)" onclick="applytonext('<?php echo $vz; ?>' ,'<?php echo $vz+1; ?>')"><img src="<?php echo $cssurl.'skin/frontend/base/default/youtubegallery/right_1.png'; ?>" /></a></td>
224
+ </tr>
225
+ <tr>
226
+ <td colspan="2">
227
+ <center>
228
+
229
+ <iframe width="<?php echo $videowidth; ?>" height="<?php echo $videoheight-40; ?>" id="player<?php echo $vz; ?>" src="http://www.youtube.com/embed/<?php echo $urlvideo; ?>?enablejsapi=1&wmode=transparent<?php if($autoplay==1){ echo '&autoplay=1';} ?>" wmode="Opaque" frameborder="0" allowfullscreen></iframe>
230
+
231
+ <?php /*?><iframe id="mksv<?php echo $vz; ?>" width="<?php echo $videowidth; ?>" height="<?php echo $videoheight-40; ?>"
232
+ src="//www.youtube.com/embed/<?php echo $urlvideo; ?>?wmode=transparent&enablejsapi=1<?php if($autoplay==1){ echo '&autoplay=1';} ?>" frameborder="0" wmode="Opaque" allowfullscreen></iframe><?php */?>
233
+ </center>
234
+ </td>
235
+ </tr>
236
+ </table>
237
+ </p>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </td>
242
+
243
+
244
+ <?php
245
+ if($vz%$onerowitem==0)
246
+ {
247
+ echo '</tr><tr>';
248
+ } ?>
249
+
250
+ <?php $vz++; } ?>
251
+ </tr>
252
+ </table>
253
+
254
+
255
+
256
+
257
+ <?php
258
+ /* Enable /Disble .................................End */
259
+ } else { ?>
260
+
261
+ <h1 style="color:red;">Enable ( MKS VIDEO GALLERY ) Module via Admin = System -> Configuration-> Configurable Setting </h1>
262
+
263
+ <?php } ?>
264
+
265
+
266
+
267
+
app/etc/modules/Manv_Youtbue.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Manv_Youtbue>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>1.1.3</version>
8
+ </Manv_Youtbue>
9
+ </modules>
10
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Manu_youtbue_video_upload</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
@@ -11,8 +11,8 @@
11
  <notes>Video upload extension allow to video. video Gallery allow to play your youtube video gallery on your website </notes>
12
  <authors><author><name>Manvendra Sharma</name><user>sharmamanvendra</user><email>sharmamanvendra6@gmail.com</email></author></authors>
13
  <date>2014-04-11</date>
14
- <time>10:54:54</time>
15
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="youtbuevideoupload.xml" hash=""/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="youtbuevideoupload.xml" hash=""/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Manu_Youtbuevideoupload.xml" hash=""/></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Manu_youtbue_video_upload</name>
4
+ <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
11
  <notes>Video upload extension allow to video. video Gallery allow to play your youtube video gallery on your website </notes>
12
  <authors><author><name>Manvendra Sharma</name><user>sharmamanvendra</user><email>sharmamanvendra6@gmail.com</email></author></authors>
13
  <date>2014-04-11</date>
14
+ <time>13:01:27</time>
15
+ <contents><target name="magecommunity"><dir name="Manv"><dir name="Youtbue"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Youtbue"><dir name="Edit"><file name="Form.php" hash="0bb4517bc8d05a61e502c7e38eb08d10"/><dir name="Tab"><file name="Form.php" hash="22163826de086176c2f7929975b4bbdb"/></dir><file name="Tabs.php" hash="522d80651cc38d3836046f75206f6020"/></dir><file name="Edit.php" hash="1d796ce870671735002225c2048bbd2f"/><file name="Grid.php" hash="48f176ea44dda1e99bf4cfc2e18bc2e2"/></dir><file name="Youtbue.php" hash="3a608e882c79c6d50327ebd8bdb2ed8f"/></dir><file name="Index.php" hash="24276b26ea08ba1355e57245a073c19f"/></dir><dir name="Helper"><file name="Data.php" hash="a46f1b5488b1be38d8e288d2b1f5b3fa"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Youtbue"><file name="Collection.php" hash="cc634781acd69afa9808426e114600be"/></dir><file name="Youtbue.php" hash="e77ce2dc47088e0a777a7054dc02cc7a"/></dir><file name="Youtbue.php" hash="698d7b5438bd744735309abbd13e6cfd"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="YoutbueController.php" hash="9a502979772345867bacb7509bf73a19"/></dir><file name="IndexController.php" hash="c6334184a5d7edd8c00582731e5301b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="90bf74e773c7156a896e2b5a39947074"/><file name="config.xml" hash="44d8bca2a8f978b47767aa81aaf69e7d"/><file name="system.xml" hash="b04be132598b8f7aaedc2393fc472858"/></dir><dir name="sql"><dir name="youtbue_setup"><file name="mysql4-install-1.1.3.php" hash="ae86fa447f20c1092bde15bd5aee6107"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="youtbue.xml" hash="df758207cc2c4fd27e53752021042dea"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="youtbue.xml" hash="2ed4312797293cc2e1dfe7342e090ed4"/></dir><dir name="template"><dir name="youtbue"><file name="index.phtml" hash="69dd37a3b31806e767b98b2f047352d8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Manv_Youtbue.xml" hash="ad073d6e4e81de85b172d5cbb86fba33"/></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.1.0</max></php></required></dependencies>
18
  </package>