forked from shaarli/Shaarli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Done: won't work because of isso-comments/isso#27 Waiting for an eventual fix.
- Loading branch information
1 parent
89f9004
commit 5670545
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
$GLOBALS['plugins']['ISSO_SERVER'] = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script data-isso="//%s/" | ||
data-isso-css="true" | ||
data-isso-lang="fr" | ||
data-isso-reply-to-self="true" | ||
data-isso-max-comments-top="20" | ||
data-isso-max-comments-nested="5" | ||
data-isso-reveal-on-click="5" | ||
data-isso-avatar="true" | ||
data-isso-avatar-bg="#f0f0f0" | ||
data-isso-avatar-fg="#9abf88 #5698c4 #e279a3 #9163b6 ..." | ||
data-isso-vote="true" | ||
data-isso-id="%s" | ||
src="//%s/js/embed.min.js"> | ||
</script> | ||
<section id="isso-thread"></section> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
// don't raise unnecessary warnings | ||
if (is_file(PluginManager::$PLUGINS_PATH . '/isso/config.php')) { | ||
include PluginManager::$PLUGINS_PATH . '/isso/config.php'; | ||
} | ||
|
||
if (!isset($GLOBALS['plugins']['ISSO_SERVER'])) { | ||
header('Content-Type: text/plain; charset=utf-8'); | ||
echo 'Isso plugin error: '. PHP_EOL; | ||
echo ' Please copy "plugins/isso/config.php.dist" to config.php and configure your isso server URL.'. PHP_EOL; | ||
echo ' You can also define "$GLOBALS[\'plugins\'][\'ISSO_SERVER\']" in your global Shaarli config.php file.'; | ||
exit; | ||
} | ||
|
||
function hook_isso_render_linklist($data) | ||
{ | ||
// Only execute when linklist is rendered. | ||
if (!empty($data['search_type']) && $data['search_type'] == 'permalink' | ||
&& count($data['links']) == 1) { | ||
|
||
$isso_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/isso/isso.html'); | ||
|
||
// data-isso-id is broken. This plugin is useless until it's fixed. | ||
// https://github.com/posativ/isso/issues/27 (2013!) | ||
$link = reset($data['links']); | ||
$isso = sprintf( | ||
$isso_html, | ||
$GLOBALS['plugins']['ISSO_SERVER'], | ||
$link['linkdate'], | ||
$GLOBALS['plugins']['ISSO_SERVER'] | ||
); | ||
$data['plugin_end_zone'][] = $isso; | ||
} | ||
|
||
return $data; | ||
} |