Skip to content

Commit 8acb1e8

Browse files
committed
Initial upload of version 2.01
0 parents  commit 8acb1e8

9 files changed

+394
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
[Dd]ebug/
46+
[Rr]elease/
47+
*_i.c
48+
*_p.c
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.vspscc
63+
.builds
64+
*.dotCover
65+
66+
## TODO: If you have NuGet Package Restore enabled, uncomment this
67+
#packages/
68+
69+
# Visual C++ cache files
70+
ipch/
71+
*.aps
72+
*.ncb
73+
*.opensdf
74+
*.sdf
75+
76+
# Visual Studio profiler
77+
*.psess
78+
*.vsp
79+
80+
# ReSharper is a .NET coding add-in
81+
_ReSharper*
82+
83+
# Installshield output folder
84+
[Ee]xpress
85+
86+
# DocProject is a documentation generator add-in
87+
DocProject/buildhelp/
88+
DocProject/Help/*.HxT
89+
DocProject/Help/*.HxC
90+
DocProject/Help/*.hhc
91+
DocProject/Help/*.hhk
92+
DocProject/Help/*.hhp
93+
DocProject/Help/Html2
94+
DocProject/Help/html
95+
96+
# Click-Once directory
97+
publish
98+
99+
# Others
100+
[Bb]in
101+
[Oo]bj
102+
sql
103+
TestResults
104+
*.Cache
105+
ClientBin
106+
stylecop.*
107+
~$*
108+
*.dbmdl
109+
Generated_Code #added for RIA/Silverlight projects
110+
111+
# Backup & report files from converting an old project file to a newer
112+
# Visual Studio version. Backup files are not needed, because we have git ;-)
113+
_UpgradeReport_Files/
114+
Backup*/
115+
UpgradeLog*.XML
116+
117+
118+
119+
############
120+
## Windows
121+
############
122+
123+
# Windows image file caches
124+
Thumbs.db
125+
126+
# Folder config file
127+
Desktop.ini
128+
129+
130+
#############
131+
## Python
132+
#############
133+
134+
*.py[co]
135+
136+
# Packages
137+
*.egg
138+
*.egg-info
139+
dist
140+
build
141+
eggs
142+
parts
143+
bin
144+
var
145+
sdist
146+
develop-eggs
147+
.installed.cfg
148+
149+
# Installer logs
150+
pip-log.txt
151+
152+
# Unit test / coverage reports
153+
.coverage
154+
.tox
155+
156+
#Translations
157+
*.mo
158+
159+
#Mr Developer
160+
.mr.developer.cfg
161+
162+
# Mac crap
163+
.DS_Store

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Similar Pages
2+
=============
3+
4+
Plugin for Cotonti CMF. Designed for
5+
6+
Description
7+
-----------
8+
9+
This is modified (v2.01) version of original plugin loaded from http://LittleDev.ru
10+
The modification is fixed up install script for latest Cotonti Siena branch.
11+
12+
Features
13+
--------
14+
15+
See. [Similar Pages](http://www.cotonti.com/page/similar_pages)
16+
17+
Install
18+
-------
19+
20+
See. [Similar Pages](http://www.cotonti.com/page/similar_pages)
21+
22+
References
23+
----------
24+
25+
* [Cotonti.com](http://Cotonti.com/) -- Home of Cotonti CMF
26+
* [Similar Pages](http://www.cotonti.com/page/similar_pages) -- Plugin home on Cotonti.com
27+
* [Home of Similar Pages](http://littledev.ru/cotontifolio/similar-pages.html) -- Home page on LittleDev.ru
28+
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
/**
4+
* Similar Pages for Cotonti CMF
5+
*
6+
* @version 2.0.0
7+
* @author esclkm, http://www.littledev.ru
8+
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
9+
*/
10+
11+
$L['cfg_limit'] = array('Max. number of similar pages');
12+
$L['cfg_relev'] = array('Relevancy');
13+
$L['cfg_catcontrol'] = array('Cat control');
14+
$L['Similar'] = 'Similar Pages';
15+
$L['NoSimilar'] = 'No similar pages';
16+
17+
?>
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/**
4+
* Similar Pages for Cotonti CMF
5+
*
6+
* @version 2.0.0
7+
* @author esclkm, http://www.littledev.ru
8+
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
9+
*/
10+
11+
$L['cfg_limit'] = array('Макс. кол-во похожих страниц');
12+
$L['cfg_relev'] = array('Релевантность');
13+
$L['cfg_catcontrol'] = array('Только из родительской категории');
14+
15+
$L['Similar'] = 'Похожие страницы';
16+
$L['NoSimilar'] = 'Похожих страниц нет';
17+
18+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Similar Pages for Cotonti CMF
4+
*
5+
* @version 2.01
6+
* @author esclkm, http://www.littledev.ru
7+
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
8+
*
9+
* // fixed for Siena 0.9.8 and up by Macik
10+
*/
11+
12+
defined('COT_CODE') or die('Wrong URL');
13+
14+
require_once cot_incfile('page', 'module');
15+
$db->query("ALTER TABLE {$db_x}pages ADD FULLTEXT(page_title)");
16+
17+
?>

similarpages/similarpages.php

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
/**
4+
* [BEGIN_COT_EXT]
5+
* Hooks=page.tags,ajax
6+
* Tags=page.tpl:{PLUGIN_SIMILARPAGES}
7+
* [END_COT_EXT]
8+
*/
9+
10+
/**
11+
* Similar Pages for Cotonti CMF
12+
*
13+
* @version 2.0.0
14+
* @author esclkm, http://www.littledev.ru
15+
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
16+
*/
17+
defined('COT_CODE') or die('Wrong URL.');
18+
19+
require_once(cot_langfile('similarpages'));
20+
require_once(cot_incfile('page', 'module'));
21+
require_once(cot_incfile('users', 'module'));
22+
23+
$relev = $cfg['plugin']['similarpages']['relev'];
24+
$limit = $cfg['plugin']['similarpages']['limit'];
25+
26+
27+
if (COT_AJAX)
28+
{
29+
$id = cot_import('id', 'G', 'INT');
30+
$sql = $db->query("SELECT page_id, page_title, page_cat FROM $db_pages WHERE page_id='$id'");
31+
$pag = $sql->fetch();
32+
}
33+
34+
$catsub = array();
35+
$catsub = cot_structure_children('page', $pag['page_cat']);
36+
if (count($catsub) > 0 && $cfg['plugin']['similarpages']['catcontrol'])
37+
{
38+
$sqladd = " AND page_cat IN ('".implode("','", $catsub)."')";
39+
}
40+
41+
$sim_p = new XTemplate(cot_tplfile('similarpages', 'plug'));
42+
$similartext = $db->prep($pag['page_title']);
43+
44+
$sql_sim = $db->query("SELECT p.*, u.* FROM $db_pages AS p LEFT JOIN $db_users AS u ON u.user_id=p.page_ownerid WHERE (p.page_state='0' OR p.page_state='2') AND p.page_id != ".$pag['page_id']." $sqladd AND MATCH (page_title) AGAINST ('$similartext')>$relev LIMIT $limit");
45+
$jj = 0;
46+
while ($pag2 = $sql_sim->fetch())
47+
{
48+
$jj++;
49+
$sim_p->assign(cot_generate_pagetags($pag2, 'PAGE_ROW_'));
50+
$sim_p->assign(array(
51+
"PAGE_ROW_ODDEVEN" => cot_build_oddeven($jj),
52+
"PAGE_ROW_NUM" => $jj,
53+
));
54+
55+
$sim_p->parse("SIMILARPAGES.SIMILAR_LIST.PAGE_ROW");
56+
}
57+
if ($jj < 1)
58+
{
59+
$sim_p->parse("SIMILARPAGES.NOSIMILAR_LIST");
60+
}
61+
else
62+
{
63+
$sim_p->parse("SIMILARPAGES.SIMILAR_LIST");
64+
}
65+
66+
$sim_p->parse("SIMILARPAGES");
67+
if (COT_AJAX)
68+
{
69+
cot_sendheaders();
70+
$sim_p->out("SIMILARPAGES");
71+
}
72+
else
73+
{
74+
$pop_text = $sim_p->text("SIMILARPAGES");
75+
$t->assign("PLUGIN_SIMILARPAGES", $pop_text);
76+
}
77+
?>

similarpages/similarpages.setup.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* [BEGIN_COT_EXT]
4+
* Code=similarpages
5+
* Name=Similar Pages
6+
* Description=Similar Pages Plugin
7+
* Version=2.00
8+
* Date=29-sep-2011
9+
* Author=esclkm, http://www.littledev.ru
10+
* Copyright=&copy; esclkm, http://www.littledev.ru 2008-2010
11+
* Notes=
12+
* SQL=
13+
* Auth_guests=R
14+
* Lock_guests=W12345A
15+
* Auth_members=R
16+
* Lock_members=W12345A
17+
* Required_modules:page
18+
* [END_COT_EXT]
19+
*
20+
* [BEGIN_COT_EXT_CONFIG]
21+
* limit=01:select:1,2,3,4,5,6,7,8,9,10:5:Number of similar pages
22+
* relev=02:select:0,1,2,3,4,5,6,7:3:Relevancy
23+
* catcontrol=03:radio::0:Cat control
24+
* [END_COT_EXT_CONFIG]
25+
*/
26+
27+
/**
28+
* Similar Pages for Cotonti CMF
29+
*
30+
* @version 2.00
31+
* @author esclkm, http://www.littledev.ru
32+
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
33+
*/
34+
35+
defined('COT_CODE') or die('Wrong URL.');
36+
37+
?>

0 commit comments

Comments
 (0)