wwjw_links - Version 2.0.0

Version Notes

1. Let your Web site also shows more than 100,000 on multiple sites,Improve your website SEO ranking,Bring to your site per day over more than 1000 unique visitors

2.The links will be added in the correct category as they are on WWJW site

3.You will not have more than 20 links per page

4. No more FTP uploads to your server

Download this release

Release Info

Developer jinguoren
Extension wwjw_links
Version 2.0.0
Comparing to
See all releases


Version 2.0.0

app/code/local/App/Searchlinks/Block/Template.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class App_Searchlinks_Block_Template extends Mage_Core_Block_Template
3
+ {
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ }
8
+ public function linksinfo()
9
+ {
10
+ // $post=$this->getRequest()->getPost();
11
+ // return $post;
12
+ }
13
+ protected function getPostPageInfo()
14
+ {
15
+ $post=$this->getRequest()->getPost();
16
+ if($post)
17
+ {
18
+ $link=trim($post['linksinfo']);
19
+ return $this->apiDataReturn(array("linkinfo"=>$link));
20
+ }
21
+ else
22
+ {
23
+ return NULL;
24
+ }
25
+
26
+ }
27
+ protected function listPageInfo()
28
+ {
29
+ $arr=$this->getRequest()->getParams();
30
+ $list=$this->apiDataReturn(array("linklist"=>"all"));
31
+ $linklist=json_decode($list,true);
32
+ return $linklist;
33
+ }
34
+
35
+ protected function cpathPageInfo()
36
+ {
37
+ $cID=$this->getRequest()->getParams();
38
+ if($cID)
39
+ {
40
+ $list=$this->apiDataReturn(array("cID"=>$cID['cID'],"size"=>$cID['size'],"order"=>$cID['order']));
41
+ return $list;
42
+ }
43
+ }
44
+ public function apiDataReturn($param)
45
+ {
46
+ if($param=='')
47
+ {
48
+ return 'Missing Parameters';
49
+ }
50
+ else
51
+ {
52
+
53
+ $contents="";
54
+ $par = "";
55
+ foreach($param as $key=>$val)
56
+ {
57
+ $par .=$key."=".$val."&";
58
+ }
59
+
60
+ $fp=fopen("http://www.wwjw.com/interface_api.php?".$par,"r");
61
+ while(!feof($fp))
62
+ {
63
+ $contents .=fgets($fp);
64
+ }
65
+ fclose($fp);
66
+ return $contents;
67
+ }
68
+ }
69
+ protected function getOrderUrl($order)
70
+ {
71
+ $by=$this->getRequest()->getParams();
72
+ if($by)
73
+ {
74
+ return $this->getUrl('wwjw_links/index/cpath/',array("size"=>$by['size'],"cID"=>$by['cID'],"order"=>$order));
75
+ }
76
+ }
77
+ public function getStyle($case)
78
+ {
79
+ $col=$this->getRequest()->getParams();
80
+ if($col['order']==$case)
81
+ {
82
+ return 'style="font-weight:bold; color:black;"';
83
+ }
84
+ else
85
+ {
86
+ return ;
87
+ }
88
+ }
89
+
90
+ protected function currentPage($size=30)
91
+ {
92
+ $cID=$this->getRequest()->getParams();
93
+ if($cID)
94
+ {
95
+
96
+ $num=$this->apiDataReturn(array("page_cID"=>$cID['cID']));
97
+ $page=floor($num/$size)+1;
98
+ $href_html="";
99
+ if($cID['size']==1||$cID['size']=="")
100
+ {
101
+ $pre="";
102
+ }
103
+ else
104
+ {
105
+ $pre='<a href="'.$this->getUrl('searchlinks/index/cpath',array("size"=>$cID['size']-1,"cID"=>$cID['cID'])).'">'.'Last'.'</a>'."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
106
+ }
107
+ $href_html .=$pre;
108
+ if($cID['size']<=$page-4)
109
+ {
110
+ $pip=$cID['size'];
111
+ $ini=$pip+4;
112
+ }
113
+ else
114
+ {
115
+ $ini=$page;
116
+ $pip=$cID['size'];
117
+ }
118
+
119
+ for($i=$pip;$i<=$ini;$i++)
120
+ {
121
+ if($i==$cID['size'])
122
+ {
123
+ $href_html .='<b>'.$cID['size'].'</b>'." ";
124
+ }
125
+ else
126
+ {
127
+ $href_html .='<a style="" href="'.$this->getUrl('searchlinks/index/cpath',array("size"=>$i,"cID"=>$cID['cID'])).'">'.$i.'</a>'." ";
128
+ }
129
+
130
+ }
131
+ if($cID['size']==$page)
132
+ {
133
+ $next=$page;
134
+ }
135
+ else
136
+ {
137
+ $next=$cID['size']+1;
138
+ }
139
+ $href_html .="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".'<a href="'.$this->getUrl('searchlinks/index/cpath',array("size"=>$next,"cID"=>$cID['cID'])).'">'.'Next'.'</a>'." ";
140
+ return $href_html;
141
+ }
142
+ else
143
+ {
144
+ return NULL;
145
+ }
146
+ }
147
+
148
+ public function errorMessage()
149
+ {
150
+ return __('The api was connect error, please check site system file');
151
+
152
+ }
153
+
154
+ }
155
+ ?>
app/code/local/App/Searchlinks/Model/Observer.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class App_Searchlinks_Model_Observer {
3
+ const FLAG_SHOW_CONFIG = 'showConfig';
4
+ const FLAG_SHOW_CONFIG_FORMAT = 'showConfigFormat';
5
+ private $request;
6
+ public function checkForConfigRequest($observer) {
7
+ $this->request = $observer->getEvent ()->getData ( 'front' )->getRequest ();
8
+ if ($this->request->{self::FLAG_SHOW_CONFIG} === 'true') {
9
+ $this->setHeader ();
10
+ $this->outputConfig ();
11
+ }
12
+ }
13
+ private function setHeader() {
14
+ $format = isset ( $this->request->{self::FLAG_SHOW_CONFIG_FORMAT} ) ? $this->request->{self::FLAG_SHOW_CONFIG_FORMAT} : 'xml';
15
+ switch ($format) {
16
+ case 'text' :
17
+ header ( "Content-Type: text/plain" );
18
+ break;
19
+ default :
20
+ header ( "Content-Type: text/xml" );
21
+ }
22
+ }
23
+ private function outputConfig() {
24
+ die ( Mage::app ()->getConfig ()->getNode ()->asXML () );
25
+ }
26
+ }
27
+ ?>
app/code/local/App/Searchlinks/controllers/IndexController.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class App_Searchlinks_IndexController extends Mage_Core_Controller_Front_Action {
3
+ public function indexAction() {
4
+ $this->loadLayout();
5
+ $this->getLayout()->getBlock('searchlinksForm')->setFormAction( Mage::getUrl('*/*/post') );
6
+ $this->renderLayout();
7
+
8
+ }
9
+ public function postAction()
10
+ {
11
+ $post=$this->getRequest()->getPost();
12
+ if($post)
13
+ {
14
+ $this->loadLayout();
15
+ $this->getLayout()->getBlock('linksinfo');
16
+ $this->renderLayout();
17
+ }
18
+ }
19
+ public function listAction()
20
+ {
21
+ $this->loadLayout();
22
+ $this->getLayout()->getBlock('linkslist');
23
+ $this->renderLayout();
24
+ }
25
+ public function cpathAction()
26
+ {
27
+ $this->loadLayout();
28
+ $this->getLayout()->getBlock('linkscpath');
29
+ $this->renderLayout();
30
+ }
31
+
32
+ }
33
+
34
+ ?>
app/code/local/App/Searchlinks/etc/config.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <config>
3
+ <modules>
4
+ <App_Searchlinks>
5
+ <version>0.1.0</version>
6
+ </App_Searchlinks>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <searchlinks>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>App_Searchlinks</module>
14
+ <frontName>wwjw_links</frontName>
15
+ </args>
16
+ </searchlinks>
17
+ </routers>
18
+ </frontend>
19
+ <global>
20
+ <blocks>
21
+ <searchlinks>
22
+ <class>App_Searchlinks_Block</class>
23
+ </searchlinks>
24
+ </blocks>
25
+
26
+ </global>
27
+
28
+ </config>
app/design/frontend/default/default/layout/local.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="root">
5
+ <reference name="top.links">
6
+ <action method="addLink" translate="label title">
7
+ <label>Link Exchange</label>
8
+ <url>wwjw_links</url>
9
+ <title>Link Exchange</title>
10
+ <prepare>true</prepare>
11
+ <liParams/>
12
+ <aParams></aParams>
13
+ <beforeText></beforeText>
14
+ <afterText></afterText>
15
+ </action>
16
+ </reference>
17
+ </reference>
18
+ </default>
19
+
20
+ <searchlinks_index_index>
21
+ <reference name="root">
22
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
23
+ </reference>
24
+ <reference name="content">
25
+ <block type="searchlinks/template" name="searchlinksForm" template="searchlinks/simple_page.phtml"/>
26
+ <block type="searchlinks/template" name="linkslist" template="searchlinks/links_list.phtml"/>
27
+ <block type="searchlinks/template" name="powerby" template="searchlinks/powerby.phtml"/>
28
+ </reference>
29
+ </searchlinks_index_index>
30
+ <searchlinks_index_post translate="label">
31
+ <reference name="root">
32
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
33
+ </reference>
34
+ <reference name="content">
35
+ <block type="searchlinks/template" name="searchlinksForm" template="searchlinks/simple_page.phtml"/>
36
+ <block type="searchlinks/template" name="linksinfo" template="searchlinks/links_info.phtml"/>
37
+ <block type="searchlinks/template" name="powerby" template="searchlinks/powerby.phtml"/>
38
+ </reference>
39
+ </searchlinks_index_post>
40
+
41
+ <searchlinks_index_list translate="label">
42
+ <reference name="root">
43
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
44
+ </reference>
45
+ <reference name="content">
46
+ <block type="searchlinks/template" name="searchlinksForm" template="searchlinks/simple_page.phtml"/>
47
+ <block type="searchlinks/template" name="linkslist" template="searchlinks/links_list.phtml"/>
48
+ <block type="searchlinks/template" name="powerby" template="searchlinks/powerby.phtml"/>
49
+ </reference>
50
+ </searchlinks_index_list>
51
+ <searchlinks_index_cpath translate="label">
52
+ <reference name="root">
53
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
54
+ </reference>
55
+ <reference name="content">
56
+ <block type="searchlinks/template" name="searchlinksForm" template="searchlinks/simple_page.phtml"/>
57
+ <block type="searchlinks/template" name="linkscpath" template="searchlinks/links_cpath.phtml"/>
58
+ <block type="searchlinks/template" name="powerby" template="searchlinks/powerby.phtml"/>
59
+ </reference>
60
+ </searchlinks_index_cpath>
61
+ </layout>
app/design/frontend/default/default/template/searchlinks/links_cpath.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <br style="clear:both;"/>
2
+ <br style="clear:both;"/>
3
+ <div style="margin:10px 0px;">
4
+
5
+ Order by :<a <?php echo $this->getStyle('D'); ?> href="<?php echo $this->getOrderUrl("D");?> ">Latest</a> | <a <?php echo $this->getStyle('H'); ?> href="<?php echo $this->getOrderUrl("H"); ?>">Hits</a> | <a <?php echo $this->getStyle('P'); ?> href="<?php echo $this->getOrderUrl("P"); ?>">PageRank</a> |<a <?php echo $this->getStyle('A'); ?> href="<?php echo $this->getOrderUrl("A");?> ">Alphabetical</a>
6
+ </div>
7
+ <?php
8
+ echo $this->cpathPageInfo();
9
+ ?>
10
+
11
+ <div id="pagelist">
12
+ <?php
13
+ echo $this->currentPage();
14
+ ?>
15
+ </div>
app/design/frontend/default/default/template/searchlinks/links_info.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <br />
2
+
3
+ <br />
4
+ <?php
5
+ echo $this->getPostPageInfo();
6
+ ?>
app/design/frontend/default/default/template/searchlinks/links_list.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ .link-category-title{width:30%;float:left;}
3
+ </style>
4
+
5
+ <?php
6
+ $link_list=$this->listPageInfo();
7
+ ?>
8
+ <br style="clear:both;"/>
9
+ <br style="clear:both;"/>
10
+ <?php
11
+ foreach($link_list as $key=>$val)
12
+ {
13
+ ?>
14
+ <div class="link-category-title"><a href="<?php echo $this->getUrl('searchlinks/index/cpath',array('cID'=>$val['ID'],"size"=>1,"order"=>'D')); ?>"><?php echo $val['TITLE']; ?></a></div>
15
+ <?php
16
+ }
17
+ ?>
app/design/frontend/default/default/template/searchlinks/powerby.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div style="width:250px;margin-top:35px;float:left;">Powered by <a href="http://www.wwjw.com">WWJW.com</a> <br />
2
+ © WWJW.com, LLC, 2003-2012
3
+ </div>
app/design/frontend/default/default/template/searchlinks/simple_page.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
2
+ <?php
3
+ //$this->sss();
4
+ ?>
5
+ <div class="page-title">
6
+ <h1><a href="<?php echo $this->getUrl('wwjw_links/index');?>"><?php echo __('Link Exchange') ?></a></h1>
7
+ </div>
8
+ <form action="<?php echo $this->getUrl('wwjw_links/index/post'); ?>" id="searchForm" method="post">
9
+ <label for="name" class="required form-list"><?php echo __('Search Links'); ?></label>
10
+ <input name="linksinfo" id="name" title="<?php echo __('linksinfo') ?>" value="" class="input-text required-entry" type="text" />
11
+ <button type="submit" title="<?php echo __('Search') ?>" class="button"><span><span><?php echo __('Search') ?></span></span></button>
12
+ <span style="margin-left:8px;">[<a href="http://localhost/wwjw_1/submit.php" style="font-weight:bold;">Add your Site</a>]</span>
13
+ </form>
14
+
15
+
16
+
17
+
18
+
app/etc/modules/App_Searchlinks.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <config>
3
+ <modules>
4
+ <App_Searchlinks>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </App_Searchlinks>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>wwjw_links</name>
4
+ <version>2.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.wwjw.com">http://www.wwjw.com</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>The Link Market's WWJW.com (Link Directory Management Service) plug-in will manage all the links that have been traded through WWJW.com website.</summary>
10
+ <description>1. Let your Web site also shows more than 100,000 on multiple sites&#xFF0C;Improve your website SEO ranking&#xFF0C;Bring to your site per day over more than 1000 unique visitors&#xD;
11
+ &#xD;
12
+ 2.The links will be added in the correct category as they are on WWJW site&#xD;
13
+ &#xD;
14
+ 3.You will not have more than 20 links per page&#xD;
15
+ &#xD;
16
+ 4. No more FTP uploads to your server</description>
17
+ <notes>1. Let your Web site also shows more than 100,000 on multiple sites&#xFF0C;Improve your website SEO ranking&#xFF0C;Bring to your site per day over more than 1000 unique visitors&#xD;
18
+ &#xD;
19
+ 2.The links will be added in the correct category as they are on WWJW site&#xD;
20
+ &#xD;
21
+ 3.You will not have more than 20 links per page&#xD;
22
+ &#xD;
23
+ 4. No more FTP uploads to your server</notes>
24
+ <authors><author><name>jinguoren</name><user>wwjw_com</user><email>wwjw.com@hotmail.com</email></author></authors>
25
+ <date>2012-11-01</date>
26
+ <time>03:00:47</time>
27
+ <contents><target name="magelocal"><dir name="App"><dir name="Searchlinks"><dir name="Block"><file name="Template.php" hash="dccf5c6c97c2e4add4d561e288431627"/></dir><dir name="Model"><file name="Observer.php" hash="62193268b27c37ff4be8a023450eef16"/></dir><dir name="controllers"><file name="IndexController.php" hash="258c09c740e2d2545bb4a7db423d26d7"/></dir><dir name="etc"><file name="config.xml" hash="4e419b514356b85175b00b568eb9c4a7"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="App_Searchlinks.xml" hash="ab880e2a62154149fe742ef916de3653"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="local.xml" hash="262cbb294b2388a39eb15927e8c23051"/></dir><dir name="template"><dir name="searchlinks"><file name="links_cpath.phtml" hash="c289a6c03a42eb200a0122fbfb8e758b"/><file name="links_info.phtml" hash="06463afd55aec030b06d8f99fa355769"/><file name="links_list.phtml" hash="0472ef3d695ac31ff5ad0482856a654b"/><file name="powerby.phtml" hash="0c54ae95ead1684f2839347899018b4a"/><file name="simple_page.phtml" hash="15ce4c675b7bd939bcf6a267f7e958c9"/></dir></dir></dir></dir></dir></target></contents>
28
+ <compatible/>
29
+ <dependencies><required><php><min>5.2.17</min><max>5.3.10</max></php><package><name>wwjw_links</name><channel>2.0</channel><min></min><max></max></package></required></dependencies>
30
+ </package>