]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Bug fix: correct get title function (missing ) )
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 3 Dec 2008 11:11:08 +0000 (11:11 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 3 Dec 2008 11:11:08 +0000 (11:11 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@189 b3834d28-1941-0410-a4f8-b48e95affb8f

admin.php
ajaxGetTitle.php
functions.inc.php
gsearch/context.php
templates/userlist.tpl.php

index c5484807e32085cc0710172d2cc32be3845c4544..99841c86988ff5456ab494eb5179cf0b08f6bd72 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -45,6 +45,7 @@ if ( !$currentUser->isAdmin() ) {
 }\r
 \r
 @list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
+
 \r
 if ( $action
 && strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0  // Prevent CSRF attacks
@@ -61,7 +62,10 @@ if ( $action
                                $bookmarkservice->deleteBookmarksForUser($uId);\r
 \r
                                $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user);\r
-                       }\r
+                       }
+                       break;
+               case 'checkUrl' :
+                       $tplVars['msg'] =  checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille";\r
                        break;\r
                default:\r
                        // DO NOTHING\r
index 2bec47c95f0ea2e4b5bc0cff8ce2c21a7fee19ac..fc895dbd295181799b7cdf0c8a6057060d22d87d 100644 (file)
@@ -43,7 +43,7 @@ function getTitle($url) {
                $encoding = strtoupper($matches[1][0]);
 
                // Convert to UTF-8 from the original encoding
-               if (function_exists("mb_convert_encoding") {
+               if (function_exists("mb_convert_encoding")) {
                        $title = @mb_convert_encoding($title, 'UTF-8', $encoding);
                }
 
index 965b120f1ca98fca22c09b3014a52d6165b90b1e..84f79c76a1efd25a8d77f8f0b51032f95a9846e8 100644 (file)
@@ -95,6 +95,19 @@ function shortenString($string, $maxSize=75) {
     return $output;
 }
 
+/* Check online if a url is a valid page (Not a 404 error for example) */
+function checkUrl($url) {
+       $h = @get_headers($url);
+       
+       //look if the page doesn't return a void or 40X or 50X HTTP code error
+       if(is_array($h) && strpos($h[0], '40') === false && strpos($h[0], '50') === false) {
+               return true;
+       } else {
+               return false;
+       }
+}
+
+
 function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) {
     if(defined('HAS_DIED'))
         die(T_('message_die() was called multiple times.'));
index 1a650636aabd5649b03c177747ea6474929d5a49..bed474d740f2e8df428c990fc50e17320ffe7927 100644 (file)
@@ -1,4 +1,11 @@
-<?php require_once('../header.inc.php');?>
+<?php
+if($GLOBALS['enableGoogleCustomSearch']==false) {
+    echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
+    die;
+}
+
+require_once('../header.inc.php');
+?>
 
 <!--?xml version="1.0" encoding="UTF-8" ?-->
 <GoogleCustomizations>
index 85c1998cf9a92b781d4807ba1bc1863c7448ace9..fdccc6266dce44c2e990e1e71315583cd76b09e8 100644 (file)
@@ -23,8 +23,12 @@ foreach($users as $user) {
        }\r
 \r
        echo '</li>'."\n";\r
-}\r
-\r
+}
+?>
+<h3><?php echo T_('Check consistancy')?></h3>
+<a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all urls')  ?></a>
+
+<?php\r
 $this->includeTemplate('sidebar.tpl');\r
 $this->includeTemplate($GLOBALS['bottom_include']);\r
 \r