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

Commit

Permalink
PHP 7.3 compat, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzelt committed Jan 21, 2019
1 parent e636523 commit ea04385
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 58 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SemanticScuttle

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.

## Features
* LDAP/Active Directory authentication
* RSS feed support: global feed, user feeds, per-tag feeds, private feeds
* Public and private bookmarks
* Delicious and Browser bookmark import
* Theming support
* Firefox plugin

## Origin

* https://sourceforge.net/projects/semanticscuttle/
* https://github.com/cweiske/SemanticScuttle
1 change: 1 addition & 0 deletions cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cache
3 changes: 1 addition & 2 deletions cache/.htaccess
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
order allow,deny
deny from all
Require all denied
6 changes: 3 additions & 3 deletions data/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
*
* @var string
*/
$dir_cache = dirname(__FILE__) . '/cache/';
$dir_cache = dirname(__DIR__, 1) . '/cache';

/**
* Use clean urls without .php filenames.
Expand Down Expand Up @@ -149,14 +149,14 @@
*
* @var string
*/
$dbtype = 'mysql4';
$dbtype = 'mysqli';

/**
* Database hostname/IP
*
* @var string
*/
$dbhost = '127.0.0.1';
$dbhost = 'localhost';

/**
* Database port.
Expand Down
6 changes: 3 additions & 3 deletions data/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $cleanurls = false;
*
* @var boolean
*/
$debugMode = true;
$debugMode = false;


/***************************************************
Expand All @@ -62,7 +62,7 @@ $debugMode = true;
*
* @var string
*/
$dbtype = 'mysql4';
$dbtype = 'mysqli';
/**
* Database username
*
Expand All @@ -89,7 +89,7 @@ $dbname = 'scuttle';
*
* @var string
*/
$dbhost = '127.0.0.1';
$dbhost = 'localhost';


/***************************************************
Expand Down
2 changes: 1 addition & 1 deletion data/schema/2.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 )
ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 );
CREATE TABLE `sc_tagscache` (
`tcId` int(11) NOT NULL auto_increment,
`tag1` varchar(100) NOT NULL default '',
Expand Down
7 changes: 5 additions & 2 deletions data/tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
-- Table structure for table `sc_bookmarks`
--

# to avoid STRICT_TRANS_TABLES mode
SET sql_mode = '';

CREATE TABLE `sc_bookmarks` (
`bId` int(11) NOT NULL auto_increment,
`uId` int(11) NOT NULL default '0',
Expand All @@ -17,8 +20,8 @@ CREATE TABLE `sc_bookmarks` (
`bDescription` text default NULL,
`bPrivateNote` text default NULL,
`bHash` varchar(32) NOT NULL default '',
`bVotes` int(11) NOT NULL,
`bVoting` int(11) NOT NULL,
`bVotes` int(11) NOT NULL default '0',
`bVoting` int(11) NOT NULL default '0',
`bShort` varchar(16) default NULL,
PRIMARY KEY (`bId`),
KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`),
Expand Down
2 changes: 1 addition & 1 deletion data/templates/default/dynamictags.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function writeTagsProposition($tagsCloud, $title)
$taglist = '';
foreach (array_keys($tagsCloud) as $key) {
$row = $tagsCloud[$key];
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
$taglist .= '<span'
. ' title="'. $row['bCount'] . ' ' . $entries . '"'
. ' style="font-size:' . $row['size'] . '"'
Expand Down
2 changes: 1 addition & 1 deletion data/templates/default/sidebar.block.popular.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}

foreach ($popularTags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
$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> ';
}
echo $contents ."\n";
Expand Down
2 changes: 1 addition & 1 deletion data/templates/default/sidebar.block.recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

foreach ($recentTags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
$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> ';
}
echo $contents ."</p>\n";
Expand Down
2 changes: 1 addition & 1 deletion data/templates/default/tags.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<?php
$contents = '';
foreach ($tags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$entries = T_ngettext('bookmark', 'bookmarks', (int)$row['bCount']);
$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> ';
}
echo $contents ."\n";
Expand Down
8 changes: 0 additions & 8 deletions res/docs/header.tpl.html

This file was deleted.

28 changes: 0 additions & 28 deletions res/docs/style.css

This file was deleted.

6 changes: 3 additions & 3 deletions src/SemanticScuttle/Service/Bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public function getBookmarks(
$tags = explode('+', trim($tags));
}

$tagcount = count($tags);
$tagcount = empty($tags) ? 0 : count($tags);
for ($i = 0; $i < $tagcount; $i ++) {
$tags[$i] = trim($tags[$i]);
}
Expand Down Expand Up @@ -853,7 +853,7 @@ public function getBookmarks(
$aTerms = array_map('trim', $aTerms);

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

// Delete final /
if (substr($address, -1) == '/') {
$address = substr($address, 0, count($address)-2);
$address = substr($address, 0, strlen($address)-2);
}

return $address;
Expand Down
10 changes: 7 additions & 3 deletions src/SemanticScuttle/Service/Bookmark2Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,12 @@ function &tagCloud($tags = NULL, $steps = 5, $sizemin = 90, $sizemax = 225, $sor
}

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

return $output;
}



/**
* Deletes all tags in bookmarks2tags
*
Expand All @@ -711,4 +709,10 @@ public function deleteAll()
}

}

function cmp($a,$b)
{
return strcasecmp(utf8_deaccent($a["tag"]), utf8_deaccent($b["tag"]));
}

?>
2 changes: 1 addition & 1 deletion www/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

0 comments on commit ea04385

Please sign in to comment.