Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.

Commit f87c477

Browse files
author
querwurzelt
committed
PHP 7.3 compat, bug fixes
1 parent e636523 commit f87c477

16 files changed

+44
-58
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SemanticScuttle
2+
3+
SemanticScuttle is a social bookmarking tool experimenting with new features like structured tags and collaborative descriptions of tags. Originally a fork of Scuttle, it has overtaken its ancestor in stability, features and usability.
4+
5+
## Features
6+
* LDAP/Active Directory authentication
7+
* RSS feed support: global feed, user feeds, per-tag feeds, private feeds
8+
* Public and private bookmarks
9+
* Delicious and Browser bookmark import
10+
* Theming support
11+
* Firefox plugin
12+
13+
## Origin
14+
15+
* https://sourceforge.net/projects/semanticscuttle/
16+
* https://github.com/cweiske/SemanticScuttle

cache/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.cache

cache/.htaccess

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
order allow,deny
2-
deny from all
1+
Require all denied

data/config.default.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
*
116116
* @var string
117117
*/
118-
$dir_cache = dirname(__FILE__) . '/cache/';
118+
$dir_cache = dirname(__DIR__, 1) . '/cache';
119119

120120
/**
121121
* Use clean urls without .php filenames.
@@ -149,14 +149,14 @@
149149
*
150150
* @var string
151151
*/
152-
$dbtype = 'mysql4';
152+
$dbtype = 'mysqli';
153153

154154
/**
155155
* Database hostname/IP
156156
*
157157
* @var string
158158
*/
159-
$dbhost = '127.0.0.1';
159+
$dbhost = 'localhost';
160160

161161
/**
162162
* Database port.

data/config.php.dist

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $cleanurls = false;
4646
*
4747
* @var boolean
4848
*/
49-
$debugMode = true;
49+
$debugMode = false;
5050

5151

5252
/***************************************************
@@ -62,7 +62,7 @@ $debugMode = true;
6262
*
6363
* @var string
6464
*/
65-
$dbtype = 'mysql4';
65+
$dbtype = 'mysqli';
6666
/**
6767
* Database username
6868
*
@@ -89,7 +89,7 @@ $dbname = 'scuttle';
8989
*
9090
* @var string
9191
*/
92-
$dbhost = '127.0.0.1';
92+
$dbhost = 'localhost';
9393

9494

9595
/***************************************************

data/schema/2.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 )
1+
ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 );
22
CREATE TABLE `sc_tagscache` (
33
`tcId` int(11) NOT NULL auto_increment,
44
`tag1` varchar(100) NOT NULL default '',

data/tables.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
-- Table structure for table `sc_bookmarks`
66
--
77

8+
SET sql_mode = '';
9+
810
CREATE TABLE `sc_bookmarks` (
911
`bId` int(11) NOT NULL auto_increment,
1012
`uId` int(11) NOT NULL default '0',
@@ -17,8 +19,8 @@ CREATE TABLE `sc_bookmarks` (
1719
`bDescription` text default NULL,
1820
`bPrivateNote` text default NULL,
1921
`bHash` varchar(32) NOT NULL default '',
20-
`bVotes` int(11) NOT NULL,
21-
`bVoting` int(11) NOT NULL,
22+
`bVotes` int(11) NOT NULL default '0',
23+
`bVoting` int(11) NOT NULL default '0',
2224
`bShort` varchar(16) default NULL,
2325
PRIMARY KEY (`bId`),
2426
KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`),

data/templates/default/dynamictags.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function writeTagsProposition($tagsCloud, $title)
5353
$taglist = '';
5454
foreach (array_keys($tagsCloud) as $key) {
5555
$row = $tagsCloud[$key];
56-
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
56+
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
5757
$taglist .= '<span'
5858
. ' title="'. $row['bCount'] . ' ' . $entries . '"'
5959
. ' style="font-size:' . $row['size'] . '"'

data/templates/default/sidebar.block.popular.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232

3333
foreach ($popularTags as $row) {
34-
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
34+
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
3535
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';
3636
}
3737
echo $contents ."\n";

data/templates/default/sidebar.block.recent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828
foreach ($recentTags as $row) {
29-
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
29+
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
3030
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';
3131
}
3232
echo $contents ."</p>\n";

data/templates/default/tags.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<?php
1717
$contents = '';
1818
foreach ($tags as $row) {
19-
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
19+
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
2020
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';
2121
}
2222
echo $contents ."\n";

res/docs/header.tpl.html

-8
This file was deleted.

res/docs/style.css

-28
This file was deleted.

src/SemanticScuttle/Service/Bookmark.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ public function getBookmarks(
734734
$tags = explode('+', trim($tags));
735735
}
736736

737-
$tagcount = count($tags);
737+
$tagcount = empty($tags) ? 0 : count($tags);
738738
for ($i = 0; $i < $tagcount; $i ++) {
739739
$tags[$i] = trim($tags[$i]);
740740
}
@@ -853,7 +853,7 @@ public function getBookmarks(
853853
$aTerms = array_map('trim', $aTerms);
854854

855855
// Search terms in tags as well when none given
856-
if (!count($tags)) {
856+
if (!empty($tags)) {
857857
$query_2 .= ' LEFT JOIN '. $b2tservice->getTableName() .' AS T'
858858
. ' ON B.bId = T.bId';
859859
$dotags = true;
@@ -1136,7 +1136,7 @@ public function normalize($address)
11361136

11371137
// Delete final /
11381138
if (substr($address, -1) == '/') {
1139-
$address = substr($address, 0, count($address)-2);
1139+
$address = substr($address, 0, strlen($address)-2);
11401140
}
11411141

11421142
return $address;

src/SemanticScuttle/Service/Bookmark2Tag.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,12 @@ function &tagCloud($tags = NULL, $steps = 5, $sizemin = 90, $sizemax = 225, $sor
691691
}
692692

693693
if ($sortOrder == 'alphabet_asc') {
694-
usort($output, create_function('$a,$b','return strcasecmp(utf8_deaccent($a["tag"]), utf8_deaccent($b["tag"]));'));
694+
usort($output, "cmp");
695695
}
696696

697697
return $output;
698698
}
699699

700-
701-
702700
/**
703701
* Deletes all tags in bookmarks2tags
704702
*
@@ -711,4 +709,10 @@ public function deleteAll()
711709
}
712710

713711
}
712+
713+
function cmp($a,$b)
714+
{
715+
return strcasecmp(utf8_deaccent($a["tag"]), utf8_deaccent($b["tag"]));
716+
}
717+
714718
?>

www/.htaccess

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Rewrite clean URLs onto real files
88
<IfModule mod_rewrite.c>
9-
Options +FollowSymlinks
9+
Options -MultiViews +FollowSymlinks
1010
RewriteEngine On
1111
RewriteCond %{REQUEST_FILENAME}.php -f
1212
RewriteRule ^([^/.]+)/?(.*)$ /$1.php/$2 [QSA,L]

0 commit comments

Comments
 (0)