Changeset 2364 in ExiteCMS


Ignore:
Timestamp:
07/29/10 17:16:11 (22 months ago)
Author:
root
Message:

merged trunk into branches PLi-Fusion and ITXP

Location:
branches
Files:
31 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/ITXP/administration/forums.php

    r2342 r2364  
    215215    $forum_attach = isset($_POST['forum_attach'])?"1":"0"; 
    216216    $forum_attachtypes = stripinput($_POST['forum_attachtypes']); 
     217    $forum_prefix = isset($_POST['forum_prefix'])?"1":"0"; 
    217218    $forum_prefixes = stripinput($_POST['forum_prefixes']); 
    218219    if ($action == "edit" && $t == "forum") { 
     
    240241        } 
    241242        // update the forum record 
    242         $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefixes='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'"); 
     243        $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefix='$forum_prefix', forum_prefixes='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'"); 
    243244        redirect(FUSION_SELF.$aidlink."&status=savefe"); 
    244245    } else { 
     
    248249            if(!$forum_order) $forum_order=dbfunction("MAX(forum_order)", "forums", "forum_cat='$forum_cat'")+1; 
    249250            $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'"); 
    250             $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_modgroup, forum_attach, forum_attachtypes, forum_prefixes, forum_rulespage, forum_banners, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_modgroup', '$forum_attach', '$forum_attachtypes', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')"); 
     251            $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_modgroup, forum_attach, forum_attachtypes, forum_prefix, forum_prefixes, forum_rulespage, forum_banners, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_modgroup', '$forum_attach', '$forum_attachtypes', '$forum_prefix', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')"); 
    251252            redirect(FUSION_SELF.$aidlink."&status=savefu"); 
    252253        } 
     
    321322            $forum_attach = $data['forum_attach']?true:false; 
    322323            $forum_attachtypes = $data['forum_attachtypes']; 
     324            $forum_prefix = $data['forum_prefix']; 
    323325            $forum_prefixes = $data['forum_prefixes']; 
    324326            $forum_title = $locale['422']; 
     
    346348        $forum_attach = ($settings['attachments'] == 1); 
    347349        $forum_attachtypes = $settings['attachtypes']; 
     350        $forum_prefix = 0; 
    348351        $forum_prefixes = ""; 
    349352        $forum_title = $locale['421']; 
     
    420423        $variables['forum_attach'] = $forum_attach; 
    421424        $variables['forum_attachtypes'] = $forum_attachtypes; 
     425        $variables['forum_prefix'] = $forum_prefix; 
    422426        $variables['forum_prefixes'] = $forum_prefixes; 
    423427        $variables['forum_rulespage'] = $forum_rulespage; 
  • branches/ITXP/administration/tools/language_pack_English.php

    r2348 r2364  
    368368        $localestrings['493'] = "Refresh Forum Ordering"; 
    369369        $localestrings['494'] = "Subject prefix list:"; 
     370        $localestrings['495'] = "Use subject prefixes in this forum"; 
    370371        load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 
    371372 
     
    25792580        $localestrings['473'] = "Comments (Max.length: 255 characters):"; 
    25802581        $localestrings['474'] = "Toggle Message"; 
     2582        $localestrings['475'] = "Error: Your are required to select a prefix when posting in this forum"; 
    25812583        $localestrings['480'] = " Make this Thread Sticky"; 
    25822584        $localestrings['481'] = " Show My Signature in this Post"; 
     
    25902592        $localestrings['500'] = "You cannot edit this post."; 
    25912593        $localestrings['501'] = "You cannot move a post that has a poll attached to it."; 
    2592         $localestrings['502'] = "You cannot edit this post. The thread has been locked by a moderator"; 
    25932594        $localestrings['530'] = "Search Forum"; 
    25942595        $localestrings['531'] = "Search Keyword(s)"; 
     
    25992600        $localestrings['550'] = "Thread Reply Notification - {THREAD_SUBJECT}"; 
    26002601        $localestrings['551'] = "Hello {USERNAME},\n\nA reply has been posted in the forum thread '{THREAD_SUBJECT}' which you are tracking at {SITE_NAME}. You can use the following link to view the reply:\n\n{THREAD_URL}\n\nIf you no longer wish to watch this thread you can click the 'Tracking Off' button located at the bottom of the thread.\n\nRegards,\n{SITE_WEBMASTER}."; 
     2602        $localestrings['552'] = "You cannot edit this post. The thread has been locked by a moderator"; 
    26012603        load_localestrings($localestrings, LP_LOCALE, "forum.post", $step); 
    26022604 
     
    38463848if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "us|gb|ca|au|nz|in|za|ir|mt|hk|pr"); 
    38473849if (!defined('LP_VERSION')) define('LP_VERSION', "7.30"); 
    3848 if (!defined('LP_DATE')) define('LP_DATE', time()); 
     3850if (!defined('LP_DATE')) define('LP_DATE', "1280139239"); 
    38493851$lp_date = LP_DATE; 
    38503852 
  • branches/ITXP/administration/tools/language_pack_Nederlands.php

    r2348 r2364  
    368368        $localestrings['493'] = "Volgorde herrekenen"; 
    369369        $localestrings['494'] = "Topic prefix lijst:"; 
     370        $localestrings['495'] = "Gebruik topic prefixen voor dit forum"; 
    370371        load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 
    371372 
     
    38463847if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "nl|be|sr|aw|an"); 
    38473848if (!defined('LP_VERSION')) define('LP_VERSION', "7.30"); 
    3848 if (!defined('LP_DATE')) define('LP_DATE', time()); 
     3849if (!defined('LP_DATE')) define('LP_DATE', "1280139245"); 
    38493850$lp_date = LP_DATE; 
    38503851 
  • branches/ITXP/files/locales/en.main.global.php

    r2348 r2364  
    33// locale       : English 
    44// locale name  : main.global 
    5 // generated on : Wed Jun 9 2010, 17:36:48 CEST 
     5// generated on : Mon Jul 26 2010, 12:14:21 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • branches/ITXP/files/locales/en.main.setup.php

    r2346 r2364  
    33// locale       : English 
    44// locale name  : main.setup 
    5 // generated on : Tue Jun 8 2010, 22:35:58 CEST 
    6 // translators  : ExiteCMS team 
     5// generated on : Wed Jun 16 2010, 19:48:07 CEST 
     6// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
    88$locale['400'] = "Select your default locale"; 
  • branches/ITXP/files/locales/nl.main.global.php

    r2348 r2364  
    33// locale       : Nederlands 
    44// locale name  : main.global 
    5 // generated on : Wed Jun 9 2010, 17:37:56 CEST 
     5// generated on : Wed Jun 16 2010, 19:48:12 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • branches/ITXP/files/locales/nl.main.setup.php

    r2346 r2364  
    33// locale       : English 
    44// locale name  : main.setup 
    5 // generated on : Tue Jun 8 2010, 22:36:03 CEST 
    6 // translators  : ExiteCMS team 
     5// generated on : Wed Jun 16 2010, 19:48:12 CEST 
     6// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
    88$locale['400'] = "Selecteer de standaard taal voor uw site"; 
  • branches/ITXP/forum/post.php

    r2348 r2364  
    6262// function to validate the contents of the $_POST array 
    6363function validatepost() { 
    64     global $locale; 
     64    global $locale, $fdata; 
    6565 
    6666    // we need both a subject and a message body 
     
    7171    if ($_POST['new_prefix'] == '[?]') $_POST['new_prefix'] = ''; 
    7272 
     73    // is a prefix required? 
     74    if ($fdata['forum_prefix'] && !empty($fdata['forum_prefixes']) && empty($_POST['new_prefix'])) { 
     75        return $locale['475']; 
     76    } 
     77 
    7378    return ""; 
    7479} 
    7580 
    7681// function to add or replace the prefix in the subject 
    77 function subject_prefix($subject, $prefix) { 
     82function strip_prefix($subject) { 
     83 
     84    $result = array('subject' => '', 'prefix' => ''); 
     85 
     86    // check for a reply, and strip the reply prefix 
     87    if (strtolower(substr($subject,0,3))=="re:") { 
     88        $result['subject'] = "Re: "; 
     89        $subject = trim(substr($subject,3)); 
     90    } 
     91 
     92    // split the subject to check for a prefix 
     93    if (preg_match('~(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     94        // a match must be at the beginning 
     95        if (empty($matches[1])) { 
     96            $result['prefix'] .= $matches[2]; 
     97            $result['subject'] .= trim($matches[3]); 
     98        } else { 
     99            $result['subject'] .= $matches[0]; 
     100        } 
     101    } else { 
     102        $result['subject'] .= $subject; 
     103    } 
     104 
     105    return $result; 
     106} 
     107 
     108// function to add or replace the prefix in the subject 
     109function add_prefix($subject, $prefix) { 
    78110 
    79111    // was a prefix defined 
     
    83115 
    84116        // split the subject to check for a prefix 
    85         if (!preg_match('~(.*)\[(.*)\](.*)~', $subject, $matches)) 
    86         { 
    87             // was this a reply? 
    88             if (strtolower(substr($subject,0,3)) == 're:') { 
    89                 $subject = 'Re: [' . $prefix . '] ' . substr($subject,4); 
     117        if (!preg_match('~(re:)(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     118 
     119            if (preg_match('~(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     120                if (empty($matches[1])) { 
     121                    $subject = '[' . $prefix . '] ' . trim($matches[3]); 
    90122            } else { 
    91123                $subject = '[' . $prefix . '] ' . $subject; 
    92124            } 
    93125        } else { 
    94             // remove spaces from the matches 
    95             foreach($matches as $key => $value) { 
    96                 $matches[$key] = trim($value); 
    97             } 
    98             unset($matches[0]); 
    99             $matches[2] = '[' . trim($prefix) . ']'; 
    100             $subject = trim(implode(' ', $matches)); 
    101         } 
     126                if (preg_match('~(re:)(.*)~i', $subject, $matches)) { 
     127                    $subject = 'Re: [' . $prefix . '] ' . trim($matches[2]); 
     128                } else { 
     129                    $subject = '[' . $prefix . '] ' . $subject; 
     130            } 
     131        } 
     132        } else { 
     133            $subject = 'Re: [' . $prefix . '] ' . trim($matches[4]); 
     134    } 
    102135    } 
    103136 
     
    490523            $preview['post_subject'] = trim(stripinput(censorwords($_POST['subject'])));; 
    491524            if ($preview['post_subject'] == "" && isset($tdata) && is_array($tdata)) { 
    492                 $preview['post_subject'] = "Re: ".$tdata['thread_subject']; 
     525                $preview['post_subject'] = add_prefix("Re: ".$tdata['thread_subject'], trim(stripinput($_POST['new_prefix']))); 
    493526            } else { 
    494                 $preview['post_subject'] = subject_prefix($preview['post_subject'], trim(stripinput($_POST['new_prefix']))); 
     527                $preview['post_subject'] = add_prefix($preview['post_subject'], trim(stripinput($_POST['new_prefix']))); 
    495528            } 
    496529            $preview['post_message'] = trim(stripmessageinput(censorwords($_POST['message']))); 
     
    614647// bail out if an edit is requested, but no edit rights have been detected 
    615648if ($action == "edit" && !$user_can_edit) { 
    616     resultdialog($locale['408'], $locale['502']); 
     649    resultdialog($locale['408'], $locale['552']); 
    617650} elseif (isset($_POST["cancel"])) { 
    618651    // post cancelled? 
     
    649682                    $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; 
    650683                    $subject = trim(stripinput(censorwords($_POST['subject']))); 
     684                    if (isset($tdata) && strtolower(substr($subject,0,3)) != "re:") { 
    651685                    if ($subject == "") { 
    652686                        $subject = "Re: ".$tdata['thread_subject']; 
     687                        } else { 
     688                            if ($action != "edit") { 
     689                                $subject = "Re: ".$subject; 
    653690                    } 
    654                     $subject = subject_prefix($subject, stripinput($_POST['new_prefix'])); 
     691                        } 
     692                    } 
     693                    if ($fdata['forum_prefix']) { 
     694                        $subject = add_prefix($subject, stripinput($_POST['new_prefix'])); 
     695                    } 
    655696                    $message = trim(stripmessageinput(censorwords($_POST['message']))); 
    656697                    if ($action == 'edit') { 
    657698                        // update the post record 
    658699                        if ($_POST['message'] == $_POST['org_message']) 
    659                             $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='$subject', post_smileys='$smileys' WHERE post_id='$post_id'"); 
     700                            $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='".mysql_real_escape_string($subject)."', post_smileys='$smileys' WHERE post_id='$post_id'"); 
    660701                        else { 
    661                             $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='$subject', post_message='$message', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='$post_id'"); 
     702                            $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='".mysql_real_escape_string($subject)."', post_message='".mysql_real_escape_string($message)."', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='$post_id'"); 
    662703                        } 
    663704                        $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id='$thread_id' ORDER BY post_datestamp ASC LIMIT 1")); 
    664705                        if ($data['post_id'] == $post_id) { 
    665                             $result = dbquery("UPDATE ".$db_prefix."threads SET thread_subject='$subject' WHERE thread_id='$thread_id'"); 
     706                            $result = dbquery("UPDATE ".$db_prefix."threads SET thread_subject='".mysql_real_escape_string($subject)."' WHERE thread_id='$thread_id'"); 
    666707                        } 
    667708                        // flag the forum and the thread as updated 
     
    808849                        rename(PATH_ATTACHMENTS.$attachment['attach_tmp'], PATH_ATTACHMENTS.$attachname); 
    809850                        chmod(PATH_ATTACHMENTS.$attachname,0664); 
    810                         $result = dbquery("INSERT INTO ".$db_prefix."forum_attachments (thread_id, post_id, attach_name, attach_realname, attach_comment, attach_ext, attach_size) VALUES ('$thread_id', '$post_id', '$attachname', '".$attachment['attach_name']."', '".$attachment['attach_comment']."', '$attachext', '".$attachment['attach_size']."')"); 
     851                        $result = dbquery("INSERT INTO ".$db_prefix."forum_attachments (thread_id, post_id, attach_name, attach_realname, attach_comment, attach_ext, attach_size) VALUES ('$thread_id', '$post_id', '".mysql_real_escape_string($attachname)."', '".mysql_real_escape_string($attachment['attach_name'])."', '".mysql_real_escape_string($attachment['attach_comment'])."', '$attachext', '".$attachment['attach_size']."')"); 
    811852                    } 
    812853                } 
     
    10201061            $variables['prefixes'] = array(); 
    10211062            foreach ($prefixes as $prefix) { 
    1022                 if (!empty($prefix)) $variables['prefixes'][] = trim($prefix); 
     1063                $prefix = trim($prefix); 
     1064                if (!empty($prefix)) $variables['prefixes'][] = $prefix; 
    10231065            } 
    10241066            if (!isset($title)) $title = $locale['415']." #".$reply_id; 
     
    10441086            } elseif ($post_id > 0 || $reply_id > 0) { 
    10451087                $subject = $pdata['post_subject']; 
    1046                 // split the subject to check for a prefix 
    1047                 if (preg_match('~(.*)\[(.*)\](.*)~', $subject, $matches)) 
    1048                 { 
    1049                     // update the subject, set the prefixes 
    1050                     $subject = trim($matches[3]); 
    1051                     $variables['prefix'] = $matches[2]; 
    1052                     $variables['new_prefix'] = '['.$matches[2].']'; 
    1053                 } 
    1054                 if ($action != "newthread" && strtolower(substr($subject,0,3)) != "re:") { 
     1088                if (!in_array($action, array("edit","newthread")) && strtolower(substr($subject,0,3)) != "re:") { 
    10551089                    $variables['subject'] = 'Re: '.$subject; 
    10561090                } else { 
     
    10881122                $bbcolor = ""; 
    10891123            } 
     1124            // do we need to deal with a subject prefix 
     1125            if (!isset($variables['prefix'])) { 
     1126                $sparray = strip_prefix($variables['subject']); 
     1127 
     1128                $variables['subject'] = $sparray['subject']; 
     1129                // check if it's a custom prefix 
     1130                if (in_array($sparray['prefix'],$variables['prefixes'])) { 
     1131                    $variables['prefix'] = $sparray['prefix']; 
     1132                    $variables['new_prefix'] = '['.$sparray['prefix'].']'; 
     1133                } else { 
     1134                    if (empty($sparray['prefix'])) { 
     1135                        $variables['prefix'] = ''; 
     1136                        $variables['new_prefix'] = '[?]'; 
     1137                    } else { 
     1138                        $variables['prefix'] = '?'; 
     1139                        $variables['new_prefix'] = '['.$sparray['prefix'].']'; 
     1140                    } 
     1141                } 
     1142            } 
     1143 
    10901144            // process attachments 
    10911145            if ($settings['attachments'] == "1" && $fdata['forum_attach'] == "1") { 
  • branches/ITXP/includes/ajax.response.php

    r2164 r2364  
    8989        // make sure we have json_encode and json_decode available 
    9090        require_once "json_include.php"; 
     91        header("Content-Type:application/json; charset=utf-8"); 
    9192        if (iMEMBER) { 
    9293            // return the user record datastore 
     
    104105            } 
    105106        } 
     107        break; 
     108    case "counters": 
     109        if (!iMEMBER) { 
     110            $pms = $posts = 0; 
     111            $pmtext = $posttext = ""; 
     112        } else { 
     113            $pms = dbcount("(pmindex_id)", "pm_index", "pmindex_user_id='".$userdata['user_id']."' AND pmindex_to_id='".$userdata['user_id']."' AND pmindex_read_datestamp = '0'"); 
     114            if ($pms == 1) { 
     115                $pmtext = sprintf($locale['085'], $pms); 
     116            } else { 
     117                $pmtext = sprintf($locale['086'], $pms); 
     118            } 
     119            if ($userdata['user_posts_unread']) { 
     120                $result = dbquery(" 
     121                    SELECT count(*) as unread 
     122                        FROM ".$db_prefix."posts p 
     123                            INNER JOIN ".$db_prefix."forums f ON p.forum_id = f.forum_id 
     124                            INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     125                        WHERE ".groupaccess('f.forum_access')." 
     126                            AND tr.user_id = '".$userdata['user_id']."' 
     127                            AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 
     128                            AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 
     129                                OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 
     130                    ); 
     131            } else { 
     132                $result = dbquery(" 
     133                    SELECT count(*) as unread 
     134                        FROM ".$db_prefix."posts p 
     135                            INNER JOIN ".$db_prefix."forums f ON p.forum_id = f.forum_id 
     136                            INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     137                        WHERE ".groupaccess('f.forum_access')." 
     138                            AND tr.user_id = '".$userdata['user_id']."' 
     139                            AND p.post_author != '".$userdata['user_id']."' 
     140                            AND p.post_edituser != '".$userdata['user_id']."' 
     141                            AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 
     142                            AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 
     143                                OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 
     144                    ); 
     145            } 
     146            $posts = ($result ? mysql_result($result, 0) : 0); 
     147            if ($posts == 1) { 
     148                $posttext = sprintf($locale['088'], $posts); 
     149            } else { 
     150                $posttext = sprintf($locale['089'], $posts); 
     151            } 
     152        } 
     153        // make sure we have json_encode and json_decode available 
     154        require_once "json_include.php"; 
     155        // send the results back 
     156        header("Content-Type:application/json; charset=utf-8"); 
     157        echo json_encode(array('pmcount' => $pms, 'pmtext' => $pmtext, 'postcount' => $posts, 'posttext' => $posttext)); 
    106158        break; 
    107159    case "pm": 
     
    211263    mysql_close(); 
    212264} 
    213 ?> 
  • branches/ITXP/includes/jscripts/core_functions.js

    r2301 r2364  
    104104        } 
    105105    } 
     106} 
     107 
     108// return a new AJAX object 
     109function asyncajaxcall() { 
     110    var result = false; 
     111    if (window.XMLHttpRequest) { 
     112        // For Safari, Firefox, and other non-MS browsers 
     113        try { 
     114            result = new XMLHttpRequest(); 
     115        } catch (e) { 
     116            result = false; 
     117        } 
     118    } else if (window.ActiveXObject) { 
     119        // For Internet Explorer on Windows 
     120        try { 
     121            result = new ActiveXObject("Msxml2.XMLHTTP"); 
     122        } catch (e) { 
     123            try { 
     124                result = new ActiveXObject("Microsoft.XMLHTTP"); 
     125            } catch (e) { 
     126                result = false; 
     127            } 
     128        } 
     129    } 
     130    return result; 
    106131} 
    107132 
  • branches/ITXP/includes/secureimage-1.0.3/securimage.php

    r2092 r2364  
    1818 * License along with this library; if not, write to the Free Software 
    1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA<br /><br /> 
    20  *  
    21  * Any modifications to the library should be indicated clearly in the source code  
     20 * 
     21 * Any modifications to the library should be indicated clearly in the source code 
    2222 * to inform users that the changes are not a part of the original software.<br /><br /> 
    2323 * 
     
    121121  var $charset = 'ABCDEFGHKLMNPRSTUVWYZ23456789'; 
    122122  //var $charset = '0123456789'; 
    123    
     123 
    124124  /** 
    125125   * Create codes using this word list 
     
    128128   */ 
    129129  var $wordlist_file = ''; 
    130    
     130 
    131131  /** 
    132132   * True to use a word list file instead of a random code 
     
    363363  var $audio_path = './audio/'; 
    364364 
     365  /** 
     366   * Captcha expiry timeout in seconds. 
     367   * 
     368   * @since 1.0.3 
     369   * @var string 
     370   */ 
     371  var $timeout = 300; 
     372 
     373 
    365374 
    366375  //END USER CONFIGURATION 
     
    423432      die('no session available!'); 
    424433    } 
    425      
     434 
    426435    // we use random colors to make it even more difficult 
    427436    $this->image_bg_color = $this->getHexColor(); 
     
    445454    return $clr; 
    446455  } 
    447     
     456 
    448457  /** 
    449458   * Generate a code and output the image to the browser. 
     
    693702  { 
    694703    $this->code = false; 
    695      
     704 
    696705    if ($this->use_wordlist && is_readable($this->wordlist_file)) { 
    697706      $this->code = $this->readCodeFromFile(); 
    698707    } 
    699      
     708 
    700709    if ($this->code == false) { 
    701710      $this->code = $this->generateCode($this->code_length); 
    702711    } 
    703      
     712 
    704713    $this->saveData(); 
    705714  } 
     
    721730    return $code; 
    722731  } 
    723    
     732 
    724733  /** 
    725734   * Reads a word list file to get a code 
     
    733742    $fp = @fopen($this->wordlist_file, 'r'); 
    734743    if (!$fp) return false; 
    735      
     744 
    736745    $fsize = filesize($this->wordlist_file); 
    737746    if ($fsize < 32) return false; // too small of a list to be effective 
    738      
     747 
    739748    if ($fsize < 128) { 
    740749      $max = $fsize; // still pretty small but changes the range of seeking 
     
    742751      $max = 128; 
    743752    } 
    744      
     753 
    745754    fseek($fp, rand(0, $fsize - $max), SEEK_SET); 
    746755    $data = fread($fp, 128); // read a random 128 bytes from file 
    747756    fclose($fp); 
    748      
     757 
    749758    $start = strpos($data, "\n", rand(0, 100)) + 1; // random start position 
    750759    $end   = strpos($data, "\n", $start) - 1; // find end of word 
    751      
     760 
    752761    return strtolower(substr($data, $start, $end - $start)); // return substring in 128 bytes 
    753762  } 
     
    822831  { 
    823832    $_SESSION['securimage_code_value'] = strtolower($this->code); 
     833    $_SESSION['securimage_code_timestamp'] = time(); 
    824834  } 
    825835 
     
    834844    if ( isset($_SESSION['securimage_code_value']) && !empty($_SESSION['securimage_code_value']) ) { 
    835845      if ( $_SESSION['securimage_code_value'] == strtolower(trim($this->code_entered)) ) { 
    836         $this->correct_code = true; 
    837         $_SESSION['securimage_code_value'] = ''; 
     846        if (isset($_SESSION['securimage_code_timestamp']) && (time() - $_SESSION['securimage_code_timestamp']) < $this->timeout) { 
     847          $this->correct_code = true; 
     848          $_SESSION['securimage_code_value'] = ''; 
     849        } else { 
     850          $this->correct_code = false; 
     851        } 
    838852      } else { 
    839853        $this->correct_code = false; 
     
    906920      $file['size']            = $data['ChunkSize'] + 8; 
    907921      $file['data']            = $body; 
    908        
     922 
    909923      if ( ($p = strpos($file['data'], 'LIST')) !== false) { 
    910924        // If the LIST data is not at the end of the file, this will probably break your sound file 
     
    914928        $file['size'] = $file['size'] - (strlen($file['data']) - $p); 
    915929      } 
    916        
     930 
    917931      $files[] = $file; 
    918932      $data    = null; 
  • branches/ITXP/includes/session_functions.php

    r2224 r2364  
    4848 
    4949// update the timestamp of the session cookie, we want expiry after the last page load, not after the session has started! 
    50 setcookie(ini_get("session.name"), session_id(), time()+ini_get("session.gc_maxlifetime"), "/"); 
     50setcookie(ini_get("session.name"), session_id(), time()+$settings['session_gc_maxlifetime'], "/"); 
    5151 
    5252// store the last_url cookie if found 
  • branches/ITXP/includes/templates/admin.forums.tpl

    r2342 r2364  
    6565            <tr> 
    6666                <td colspan='2' class='tbl'> 
     67                    <input type='checkbox' name='forum_prefix' value='1' onchange='togglefields("prefixes");'{if $forum_prefix} checked="checked"{/if} /> {$locale.495} 
     68                </td> 
     69            </tr> 
     70            <tr id='prefixes'{if !$forum_prefix} style='display:none'{/if}> 
     71                <td colspan='2' class='tbl'> 
    6772                    {$locale.494} 
    6873                    <br /> 
     
    145150            <tr> 
    146151                <td colspan='2' class='tbl'> 
    147                     <input type='checkbox' name='forum_attach' value='1' onchange='togglefields();'{if $forum_attach} checked="checked"{/if} /> {$locale.469} 
     152                    <input type='checkbox' name='forum_attach' value='1' onchange='togglefields("attachtypes");'{if $forum_attach} checked="checked"{/if} /> {$locale.469} 
    148153                </td> 
    149154            </tr> 
     
    167172    </form> 
    168173{literal}<script type='text/javascript'> 
    169 function togglefields() { 
     174function togglefields(name) { 
    170175    if(navigator.appName.indexOf('Microsoft') > -1) { 
    171176        state = 'block'; 
     
    173178        state = 'table-row'; 
    174179    } 
    175     if (document.getElementById('attachtypes').style.display == 'none') { 
    176         document.getElementById('attachtypes').style.display = state; 
     180    if (document.getElementById(name).style.display == 'none') { 
     181        document.getElementById(name).style.display = state; 
    177182    } else { 
    178         document.getElementById('attachtypes').style.display = 'none'; 
     183        document.getElementById(name).style.display = 'none'; 
    179184    } 
    180185} 
  • branches/ITXP/includes/templates/forum.index.tpl

    r2346 r2364  
    151151            {buttonlink name=$locale.415 link="tracking.php"} 
    152152            {buttonlink name=$locale.414 link="viewposts.php"}<br /> 
    153             <form name='searchform' method='post' style="margin-top:2px;" action='{$smarty.const.BASEDIR}search.php?stype=f'> 
     153            <form name='searchform' method='post' style="margin-top:2px;" action='{$smarty.const.BASEDIR}search.php?action=search'> 
    154154                <input type='text' name='stext' class='textbox' style='width:150px' /> 
     155                <input type='hidden' name='boolean' value='1' /> 
     156                <input type='hidden' name='qtype' value='AND' /> 
     157                <input type='hidden' name='search_id' value='3.2' /> 
     158                <input type='hidden' name='sortby' value='datestamp' /> 
     159                <input type='hidden' name='order' value='0' /> 
     160                <input type='hidden' name='limit' value='0' /> 
     161                <input type='hidden' name='datelimit' value='0' /> 
     162                <input type='hidden' name='contentfilter_users' value='0' /> 
     163                <input type='hidden' name='contentfilter_forums' value='0' /> 
    155164                <input type='submit' name='search' value='{$locale.550}' class='button' /> 
    156165            </form> 
  • branches/ITXP/includes/templates/forum.post.tpl

    r2348 r2364  
    124124            <td> 
    125125                <table width='100%' border='0' cellspacing='1' cellpadding='0'> 
    126                     <tr> 
     126                    <tr {if $forum.forum_prefix == 0}style="display:none;"{/if}> 
    127127                        <td align='right' width='145' valign='top' class='tbl2'> 
    128128                            {$locale.533}: 
    129129                        </td> 
    130130                        <td class='tbl1'> 
    131                             <select name="prefix" class="textbox" style="width:125px;" onChange="javascript:update_prefix(this);"> 
    132                                 <option value="">{$locale.534}</option> 
     131                            {assign var=show_prefix value=0} 
     132                            <select name="prefix" class="textbox" style="width:125px;" onChange="update_prefix(this);"> 
     133                                <option value="" {if $prefix == ""}selected="selected"{/if}>{$locale.534}</option> 
    133134                            {foreach from=$prefixes item=post_prefix} 
    134135                                <option value="{$post_prefix}" {if $prefix == $post_prefix}selected="selected"{/if}>{$post_prefix}</option> 
    135136                            {/foreach} 
    136                                 <option value="?">{$locale.535}</option> 
     137                                <option value="?" {if $prefix == "?"}selected="selected"{assign var=show_prefix value=1}{/if}>{$locale.535}</option> 
    137138                            </select> 
    138                             <input type='text' id="new_prefix" name='new_prefix' value='{$new_prefix}' class='textbox' maxlength='255' style='width: 250px' disabled="disabled" /> 
     139                            <input type='text' id="new_prefix" name='new_prefix' value='{$new_prefix}' class='textbox' maxlength='255' style='width: 250px;{if $show_prefix ==0}display:none;{/if}' /> 
    139140                        </td> 
    140141                    </tr> 
     
    150151                    <tr> 
    151152                        <td align='right' width='145' class='tbl2' valign='top' style='white-space:nowrap'> 
    152                             <input type='submit' class='button' name='toggle_msg' value='{$locale.474}' onclick='javascript:flipDiv("org_message");return false;' /> 
     153                            <input type='submit' class='button' name='toggle_msg' value='{$locale.474}' onclick='flipDiv("org_message");return false;' /> 
    153154                        </td> 
    154155                        <td class='tbl1'> 
     
    194195                    <tr> 
    195196                        <td align='right' width='145' valign='top' class='tbl2'> 
    196                             <input type='button' name='toggle' class='button' value='{$locale.467}' onclick='javascript:loadSmileys("smileys", "smileys_loaded", "{$smarty.const.BASEDIR}includes/ajax.response.php?request=smileys&parms=message");return false;' /> 
     197                            <input type='button' name='toggle' class='button' value='{$locale.467}' onclick='loadSmileys("smileys", "smileys_loaded", "{$smarty.const.BASEDIR}includes/ajax.response.php?request=smileys&parms=message");return false;' /> 
    197198                        </td> 
    198199                        <td class='tbl1'> 
     
    266267                                <input type='submit' name='upload' value='{$locale.471}' class='button' /> 
    267268                            {else} 
    268                                 <input type='submit' name='upload' value='{$locale.471}' class='button' onclick='javascript:get_hoteditor_data("message");' /> 
     269                                <input type='submit' name='upload' value='{$locale.471}' class='button' onclick='get_hoteditor_data("message");' /> 
    269270                            {/if} 
    270271                        </td> 
     
    309310                                <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' /> 
    310311                            {else} 
    311                                 <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' onclick='javascript:get_hoteditor_data("message");' /> 
     312                                <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' onclick='get_hoteditor_data("message");' /> 
    312313                            {/if} 
    313314                        {/if} 
     
    380381                    <input type='submit' name='save' value='{$button_save}' class='button' /> 
    381382                {else} 
    382                     <input type='submit' name='preview' value='{$button_preview}' class='button' onclick='javascript:document.getElementById("new_prefix").disabled = false;get_hoteditor_data("message");' /> 
    383                     <input type='submit' name='save' value='{$button_save}' class='button' onclick='javascript:document.getElementById("new_prefix").disabled = false;get_hoteditor_data("message");' /> 
     383                    <input type='submit' name='preview' value='{$button_preview}' class='button' onclick='get_hoteditor_data("message");' /> 
     384                    <input type='submit' name='save' value='{$button_save}' class='button' onclick='get_hoteditor_data("message");' /> 
    384385                {/if} 
    385386                <input type='hidden' name='post_author' value='{$post_author}' /> 
     
    413414    if ( el.value == "?") { 
    414415        document.getElementById('new_prefix').value = "[?]"; 
    415         document.getElementById('new_prefix').disabled = false; 
     416        document.getElementById('new_prefix').style.display = 'inline'; 
    416417        document.getElementById('new_prefix').focus = true; 
    417418    }   else { 
    418         document.getElementById('new_prefix').disabled = true; 
     419        document.getElementById('new_prefix').style.display = 'none'; 
    419420        if ( el.value == "") { 
    420421            document.getElementById('new_prefix').value = ""; 
  • branches/ITXP/themes/ExiteCMS/templates/templates/_header.tpl

    r2301 r2364  
    3838    {/literal} 
    3939    {if $favicon|default:false != false}<link rel='shortcut icon' href='{$favicon}' />{/if} 
    40     <script type='text/javascript' src='{$smarty.const.INCLUDES}jscripts/core_functions.js?version=3'></script> 
     40    <script type='text/javascript' src='{$smarty.const.INCLUDES}jscripts/core_functions.js?version=4'></script> 
    4141    {if $smarty.const.LOAD_TINYMCE} 
    4242        {include file="_load_tinymce.tpl"} 
     
    8888createCookie('width', myWidth, 0); 
    8989createCookie('height', myHeight, 0); 
    90  
     90// 
     91// Dynamic fontsize 
     92// 
    9193var fontGrootte = 0.7; 
    9294var pliCookie = readCookie('pliFontSize'); 
     
    117119 
    118120fontReset(fontGrootte); 
    119  
     121{/literal} 
     122{if iMEMBER} 
     123{literal} 
     124// 
     125// PM and forum post counter checks 
     126// 
    120127function checkMessages() { 
    121     // check for new forum messages 
    122     var newmsg = AjaxCall("{/literal}{$smarty.const.BASEDIR}{literal}includes/ajax.response.php?request=posts"); 
    123     if (newmsg != null && document.getElementById("new_posts_header")) { 
    124         if (newmsg > 0) { 
    125             document.getElementById("new_posts_header").innerHTML = "<a href='{/literal}{$smarty.const.BASEDIR}{literal}modules/forum_threads_list_panel/new_posts.php'><img src='{/literal}{$smarty.const.THEME}{literal}images/newposts.gif' height='9' alt='{/literal}{$locale.028}{literal}' /></a>&nbsp;"; 
    126         } else { 
    127             document.getElementById("new_posts_header").innerHTML = ""; 
     128    // check for new pm messages 
     129    var asyncajax = asyncajaxcall(); 
     130    if (asyncajax) { 
     131        try { 
     132            // Asynchronous request, wait till we have it all 
     133            asyncajax.open('GET', exitecms_basedir + "includes/ajax.response.php?request=counters", true); 
     134            asyncajax.onreadystatechange = function() { 
     135                if(asyncajax.readyState == 4) { 
     136                    if (asyncajax.status == 200) { 
     137                        try { 
     138                            // update the new message indicator 
     139                            newmsg = eval('('+asyncajax.responseText+')'); 
     140                            if (document.getElementById("new_pm_header")) { 
     141                                if (parseInt(newmsg.pmcount) > 0) { 
     142                                    document.getElementById("new_pm_header").innerHTML = "<a href='" + exitecms_basedir + "pm.php?action=show_new'><img src='" + exitecms_themedir + "images/newmsgs.gif' height='9' alt='' /></a>&nbsp;"; 
     143                                } else { 
     144                                    document.getElementById("new_pm_header").innerHTML = ''; 
     145                                } 
     146                            } 
     147                            if (document.getElementById("new_pm_panel")) { 
     148                                if (parseInt(newmsg.pmcount) > 0) { 
     149                                    document.getElementById("new_pm_panel_value").innerHTML = newmsg.pmtext; 
     150                                    document.getElementById("new_pm_panel").style.display = 'inline'; 
     151                                } else { 
     152                                    document.getElementById("new_pm_panel").style.display = 'none'; 
     153                                } 
     154                            } 
     155                            if (document.getElementById("new_posts_header")) { 
     156                                if (parseInt(newmsg.postcount) > 0) { 
     157                                    document.getElementById("new_posts_header").innerHTML = "<a href='" + exitecms_basedir + "modules/forum_threads_list_panel/new_posts.php'><img src='" + exitecms_themedir + "images/newposts.gif' height='9' alt='" + locale_028 + "' /></a>&nbsp;"; 
     158                                } else { 
     159                                    document.getElementById("new_posts_header").innerHTML = ''; 
     160                                } 
     161                            } 
     162                            if (document.getElementById("new_posts_panel")) { 
     163                                if (parseInt(newmsg.postcount) > 0) { 
     164                                    document.getElementById("new_posts_panel_value").innerHTML = newmsg.posttext; 
     165                                    document.getElementById("new_posts_panel").style.display = 'inline'; 
     166                                } else { 
     167                                    document.getElementById("new_posts_panel").style.display = 'none'; 
     168                                } 
     169                            } 
     170                            // set a timer for the next check 
     171                            msgtimerid = setTimeout("checkMessages()", 60000); 
     172                        } 
     173                        catch (e) { 
     174                            // catch the error 
     175                        } 
     176                    } 
     177                } 
     178            }; 
     179            asyncajax.send(null); 
     180        } catch (e) { 
     181            return null; 
    128182        } 
     183    } else { 
     184        return null; 
    129185    } 
    130     if (newmsg != null && document.getElementById("new_posts_panel")) { 
    131         if (newmsg > 0) { 
    132             document.getElementById("new_posts_panel_value").innerHTML = AjaxCall("{/literal}{$smarty.const.BASEDIR}{literal}includes/ajax.response.php?request=posts&parms=text"); 
    133             document.getElementById("new_posts_panel").style.display = 'inline'; 
    134         } else { 
    135             document.getElementById("new_posts_panel").style.display = 'none'; 
    136         } 
    137     } 
    138     // check for new pm messages 
    139     var newpm = AjaxCall("{/literal}{$smarty.const.BASEDIR}{literal}includes/ajax.response.php?request=pm"); 
    140     if (newpm != null && document.getElementById("new_pm_header")) { 
    141         if (newpm > 0) { 
    142             document.getElementById("new_pm_header").innerHTML = "<a href='{/literal}{$smarty.const.BASEDIR}{literal}pm.php?action=show_new'><img src='{/literal}{$smarty.const.THEME}{literal}images/newmsgs.gif' height='9' alt='' /></a>&nbsp;"; 
    143         } else { 
    144             document.getElementById("new_pm_header").innerHTML = ""; 
    145         } 
    146     } 
    147     if (newpm != null && document.getElementById("new_pm_panel")) { 
    148         if (newpm > 0) { 
    149             document.getElementById("new_pm_panel_value").innerHTML = AjaxCall("{/literal}{$smarty.const.BASEDIR}{literal}includes/ajax.response.php?request=pm&parms=text"); 
    150             document.getElementById("new_pm_panel").style.display = 'inline'; 
    151         } else { 
    152             document.getElementById("new_pm_panel").style.display = 'none'; 
    153         } 
    154     } 
    155     // restart the timer for the next check, in 5 minutes 
    156     msgtimerid = setTimeout("checkMessages()", 300000); 
    157186} 
    158187{/literal} 
    159 {if iMEMBER} 
    160 // start the timer for the first check, in 5 minutes 
    161 msgtimerid = setTimeout("checkMessages()", 300000); 
     188var locale_028 = "{$locale.028}"; 
     189var exitecms_basedir = "{$smarty.const.BASEDIR}"; 
     190var exitecms_themedir = "{$smarty.const.THEME}"; 
     191// start the timer for the first check, in 1 minute 
     192msgtimerid = setTimeout("checkMessages()", 60000); 
    162193{/if} 
    163194/* ]]> */ 
  • branches/PLi-Fusion/administration/forums.php

    r2342 r2364  
    215215    $forum_attach = isset($_POST['forum_attach'])?"1":"0"; 
    216216    $forum_attachtypes = stripinput($_POST['forum_attachtypes']); 
     217    $forum_prefix = isset($_POST['forum_prefix'])?"1":"0"; 
    217218    $forum_prefixes = stripinput($_POST['forum_prefixes']); 
    218219    if ($action == "edit" && $t == "forum") { 
     
    240241        } 
    241242        // update the forum record 
    242         $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefixes='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'"); 
     243        $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefix='$forum_prefix', forum_prefixes='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'"); 
    243244        redirect(FUSION_SELF.$aidlink."&status=savefe"); 
    244245    } else { 
     
    248249            if(!$forum_order) $forum_order=dbfunction("MAX(forum_order)", "forums", "forum_cat='$forum_cat'")+1; 
    249250            $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'"); 
    250             $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_modgroup, forum_attach, forum_attachtypes, forum_prefixes, forum_rulespage, forum_banners, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_modgroup', '$forum_attach', '$forum_attachtypes', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')"); 
     251            $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_modgroup, forum_attach, forum_attachtypes, forum_prefix, forum_prefixes, forum_rulespage, forum_banners, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_modgroup', '$forum_attach', '$forum_attachtypes', '$forum_prefix', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')"); 
    251252            redirect(FUSION_SELF.$aidlink."&status=savefu"); 
    252253        } 
     
    321322            $forum_attach = $data['forum_attach']?true:false; 
    322323            $forum_attachtypes = $data['forum_attachtypes']; 
     324            $forum_prefix = $data['forum_prefix']; 
    323325            $forum_prefixes = $data['forum_prefixes']; 
    324326            $forum_title = $locale['422']; 
     
    346348        $forum_attach = ($settings['attachments'] == 1); 
    347349        $forum_attachtypes = $settings['attachtypes']; 
     350        $forum_prefix = 0; 
    348351        $forum_prefixes = ""; 
    349352        $forum_title = $locale['421']; 
     
    420423        $variables['forum_attach'] = $forum_attach; 
    421424        $variables['forum_attachtypes'] = $forum_attachtypes; 
     425        $variables['forum_prefix'] = $forum_prefix; 
    422426        $variables['forum_prefixes'] = $forum_prefixes; 
    423427        $variables['forum_rulespage'] = $forum_rulespage; 
  • branches/PLi-Fusion/administration/tools/language_pack_English.php

    r2348 r2364  
    368368        $localestrings['493'] = "Refresh Forum Ordering"; 
    369369        $localestrings['494'] = "Subject prefix list:"; 
     370        $localestrings['495'] = "Use subject prefixes in this forum"; 
    370371        load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 
    371372 
     
    25792580        $localestrings['473'] = "Comments (Max.length: 255 characters):"; 
    25802581        $localestrings['474'] = "Toggle Message"; 
     2582        $localestrings['475'] = "Error: Your are required to select a prefix when posting in this forum"; 
    25812583        $localestrings['480'] = " Make this Thread Sticky"; 
    25822584        $localestrings['481'] = " Show My Signature in this Post"; 
     
    25902592        $localestrings['500'] = "You cannot edit this post."; 
    25912593        $localestrings['501'] = "You cannot move a post that has a poll attached to it."; 
    2592         $localestrings['502'] = "You cannot edit this post. The thread has been locked by a moderator"; 
    25932594        $localestrings['530'] = "Search Forum"; 
    25942595        $localestrings['531'] = "Search Keyword(s)"; 
     
    25992600        $localestrings['550'] = "Thread Reply Notification - {THREAD_SUBJECT}"; 
    26002601        $localestrings['551'] = "Hello {USERNAME},\n\nA reply has been posted in the forum thread '{THREAD_SUBJECT}' which you are tracking at {SITE_NAME}. You can use the following link to view the reply:\n\n{THREAD_URL}\n\nIf you no longer wish to watch this thread you can click the 'Tracking Off' button located at the bottom of the thread.\n\nRegards,\n{SITE_WEBMASTER}."; 
     2602        $localestrings['552'] = "You cannot edit this post. The thread has been locked by a moderator"; 
    26012603        load_localestrings($localestrings, LP_LOCALE, "forum.post", $step); 
    26022604 
     
    38463848if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "us|gb|ca|au|nz|in|za|ir|mt|hk|pr"); 
    38473849if (!defined('LP_VERSION')) define('LP_VERSION', "7.30"); 
    3848 if (!defined('LP_DATE')) define('LP_DATE', time()); 
     3850if (!defined('LP_DATE')) define('LP_DATE', "1280139239"); 
    38493851$lp_date = LP_DATE; 
    38503852 
  • branches/PLi-Fusion/administration/tools/language_pack_Nederlands.php

    r2348 r2364  
    368368        $localestrings['493'] = "Volgorde herrekenen"; 
    369369        $localestrings['494'] = "Topic prefix lijst:"; 
     370        $localestrings['495'] = "Gebruik topic prefixen voor dit forum"; 
    370371        load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 
    371372 
     
    25792580        $localestrings['473'] = "Commentaar (Max.lengte: 255 tekens):"; 
    25802581        $localestrings['474'] = "Orgineel bericht"; 
     2582        $localestrings['475'] = "Fout: U bent verplicht een prefix te kiezen als u een bericht in dit forum wilt plaatsen"; 
    25812583        $localestrings['480'] = " Maak deze topic belangrijk"; 
    25822584        $localestrings['481'] = " Toon mijn handtekening onder dit bericht"; 
     
    25902592        $localestrings['500'] = "U kunt dit bericht niet wijzigen."; 
    25912593        $localestrings['501'] = "U kunt geen bericht verplaatsen waaraan een poll is gekoppeld."; 
    2592         $localestrings['502'] = "U kunt dit bericht niet wijzigen. Deze topic is gesloten door een moderator."; 
    25932594        $localestrings['530'] = "Zoeken"; 
    25942595        $localestrings['531'] = "Zoekwoord(en)"; 
     
    25992600        $localestrings['550'] = "Notificatie van anwoord op topic - {THREAD_SUBJECT}"; 
    26002601        $localestrings['551'] = "Hallo {USERNAME},\n\nEr is een antwoord geplaatst in de forum topic '{THREAD_SUBJECT}' welke u volgt op {SITE_NAME}. U kunt de volgende link gebruiken om het antwoord te lezen:\n\n{THREAD_URL}\n\nAls u dit topic niet langer wil volgen, klik dan op de 'Stop het volgen van dit topic' knop die u onderaan het topic scherm kunt vinden.\n\nMet vriendelijke groeten,\n{SITE_WEBMASTER}."; 
     2602        $localestrings['552'] = "U kunt dit bericht niet wijzigen. Deze topic is gesloten door een moderator."; 
    26012603        load_localestrings($localestrings, LP_LOCALE, "forum.post", $step); 
    26022604 
     
    38463848if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "nl|be|sr|aw|an"); 
    38473849if (!defined('LP_VERSION')) define('LP_VERSION', "7.30"); 
    3848 if (!defined('LP_DATE')) define('LP_DATE', time()); 
     3850if (!defined('LP_DATE')) define('LP_DATE', "1280139245"); 
    38493851$lp_date = LP_DATE; 
    38503852 
  • branches/PLi-Fusion/files/locales/en.main.global.php

    r2348 r2364  
    33// locale       : English 
    44// locale name  : main.global 
    5 // generated on : Wed Jun 9 2010, 17:36:48 CEST 
     5// generated on : Mon Jul 26 2010, 12:14:21 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • branches/PLi-Fusion/files/locales/en.main.setup.php

    r2346 r2364  
    33// locale       : English 
    44// locale name  : main.setup 
    5 // generated on : Tue Jun 8 2010, 22:35:58 CEST 
    6 // translators  : ExiteCMS team 
     5// generated on : Wed Jun 16 2010, 19:48:07 CEST 
     6// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
    88$locale['400'] = "Select your default locale"; 
  • branches/PLi-Fusion/files/locales/nl.main.global.php

    r2348 r2364  
    33// locale       : Nederlands 
    44// locale name  : main.global 
    5 // generated on : Wed Jun 9 2010, 17:37:56 CEST 
     5// generated on : Wed Jun 16 2010, 19:48:12 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • branches/PLi-Fusion/files/locales/nl.main.setup.php

    r2346 r2364  
    33// locale       : English 
    44// locale name  : main.setup 
    5 // generated on : Tue Jun 8 2010, 22:36:03 CEST 
    6 // translators  : ExiteCMS team 
     5// generated on : Wed Jun 16 2010, 19:48:12 CEST 
     6// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
    88$locale['400'] = "Selecteer de standaard taal voor uw site"; 
  • branches/PLi-Fusion/forum/post.php

    r2348 r2364  
    6262// function to validate the contents of the $_POST array 
    6363function validatepost() { 
    64     global $locale; 
     64    global $locale, $fdata; 
    6565 
    6666    // we need both a subject and a message body 
     
    7171    if ($_POST['new_prefix'] == '[?]') $_POST['new_prefix'] = ''; 
    7272 
     73    // is a prefix required? 
     74    if ($fdata['forum_prefix'] && !empty($fdata['forum_prefixes']) && empty($_POST['new_prefix'])) { 
     75        return $locale['475']; 
     76    } 
     77 
    7378    return ""; 
    7479} 
    7580 
    7681// function to add or replace the prefix in the subject 
    77 function subject_prefix($subject, $prefix) { 
     82function strip_prefix($subject) { 
     83 
     84    $result = array('subject' => '', 'prefix' => ''); 
     85 
     86    // check for a reply, and strip the reply prefix 
     87    if (strtolower(substr($subject,0,3))=="re:") { 
     88        $result['subject'] = "Re: "; 
     89        $subject = trim(substr($subject,3)); 
     90    } 
     91 
     92    // split the subject to check for a prefix 
     93    if (preg_match('~(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     94        // a match must be at the beginning 
     95        if (empty($matches[1])) { 
     96            $result['prefix'] .= $matches[2]; 
     97            $result['subject'] .= trim($matches[3]); 
     98        } else { 
     99            $result['subject'] .= $matches[0]; 
     100        } 
     101    } else { 
     102        $result['subject'] .= $subject; 
     103    } 
     104 
     105    return $result; 
     106} 
     107 
     108// function to add or replace the prefix in the subject 
     109function add_prefix($subject, $prefix) { 
    78110 
    79111    // was a prefix defined 
     
    83115 
    84116        // split the subject to check for a prefix 
    85         if (!preg_match('~(.*)\[(.*)\](.*)~', $subject, $matches)) 
    86         { 
    87             // was this a reply? 
    88             if (strtolower(substr($subject,0,3)) == 're:') { 
    89                 $subject = 'Re: [' . $prefix . '] ' . substr($subject,4); 
     117        if (!preg_match('~(re:)(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     118 
     119            if (preg_match('~(.*?)\[(.*?)\](.*)~i', $subject, $matches)) { 
     120                if (empty($matches[1])) { 
     121                    $subject = '[' . $prefix . '] ' . trim($matches[3]); 
    90122            } else { 
    91123                $subject = '[' . $prefix . '] ' . $subject; 
    92124            } 
    93125        } else { 
    94             // remove spaces from the matches 
    95             foreach($matches as $key => $value) { 
    96                 $matches[$key] = trim($value); 
    97             } 
    98             unset($matches[0]); 
    99             $matches[2] = '[' . trim($prefix) . ']'; 
    100             $subject = trim(implode(' ', $matches)); 
    101         } 
     126                if (preg_match('~(re:)(.*)~i', $subject, $matches)) { 
     127                    $subject = 'Re: [' . $prefix . '] ' . trim($matches[2]); 
     128                } else { 
     129                    $subject = '[' . $prefix . '] ' . $subject; 
     130            } 
     131        } 
     132        } else { 
     133            $subject = 'Re: [' . $prefix . '] ' . trim($matches[4]); 
     134    } 
    102135    } 
    103136 
     
    490523            $preview['post_subject'] = trim(stripinput(censorwords($_POST['subject'])));; 
    491524            if ($preview['post_subject'] == "" && isset($tdata) && is_array($tdata)) { 
    492                 $preview['post_subject'] = "Re: ".$tdata['thread_subject']; 
     525                $preview['post_subject'] = add_prefix("Re: ".$tdata['thread_subject'], trim(stripinput($_POST['new_prefix']))); 
    493526            } else { 
    494                 $preview['post_subject'] = subject_prefix($preview['post_subject'], trim(stripinput($_POST['new_prefix']))); 
     527                $preview['post_subject'] = add_prefix($preview['post_subject'], trim(stripinput($_POST['new_prefix']))); 
    495528            } 
    496529            $preview['post_message'] = trim(stripmessageinput(censorwords($_POST['message']))); 
     
    614647// bail out if an edit is requested, but no edit rights have been detected 
    615648if ($action == "edit" && !$user_can_edit) { 
    616     resultdialog($locale['408'], $locale['502']); 
     649    resultdialog($locale['408'], $locale['552']); 
    617650} elseif (isset($_POST["cancel"])) { 
    618651    // post cancelled? 
     
    649682                    $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; 
    650683                    $subject = trim(stripinput(censorwords($_POST['subject']))); 
     684                    if (isset($tdata) && strtolower(substr($subject,0,3)) != "re:") { 
    651685                    if ($subject == "") { 
    652686                        $subject = "Re: ".$tdata['thread_subject']; 
     687                        } else { 
     688                            if ($action != "edit") { 
     689                                $subject = "Re: ".$subject; 
    653690                    } 
    654                     $subject = subject_prefix($subject, stripinput($_POST['new_prefix'])); 
     691                        } 
     692                    } 
     693                    if ($fdata['forum_prefix']) { 
     694                        $subject = add_prefix($subject, stripinput($_POST['new_prefix'])); 
     695                    } 
    655696                    $message = trim(stripmessageinput(censorwords($_POST['message']))); 
    656697                    if ($action == 'edit') { 
    657698                        // update the post record 
    658699                        if ($_POST['message'] == $_POST['org_message']) 
    659                             $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='$subject', post_smileys='$smileys' WHERE post_id='$post_id'"); 
     700                            $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='".mysql_real_escape_string($subject)."', post_smileys='$smileys' WHERE post_id='$post_id'"); 
    660701                        else { 
    661                             $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='$subject', post_message='$message', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='$post_id'"); 
     702                            $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='".mysql_real_escape_string($subject)."', post_message='".mysql_real_escape_string($message)."', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='$post_id'"); 
    662703                        } 
    663704                        $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id='$thread_id' ORDER BY post_datestamp ASC LIMIT 1")); 
    664705                        if ($data['post_id'] == $post_id) { 
    665                             $result = dbquery("UPDATE ".$db_prefix."threads SET thread_subject='$subject' WHERE thread_id='$thread_id'"); 
     706                            $result = dbquery("UPDATE ".$db_prefix."threads SET thread_subject='".mysql_real_escape_string($subject)."' WHERE thread_id='$thread_id'"); 
    666707                        } 
    667708                        // flag the forum and the thread as updated 
     
    808849                        rename(PATH_ATTACHMENTS.$attachment['attach_tmp'], PATH_ATTACHMENTS.$attachname); 
    809850                        chmod(PATH_ATTACHMENTS.$attachname,0664); 
    810                         $result = dbquery("INSERT INTO ".$db_prefix."forum_attachments (thread_id, post_id, attach_name, attach_realname, attach_comment, attach_ext, attach_size) VALUES ('$thread_id', '$post_id', '$attachname', '".$attachment['attach_name']."', '".$attachment['attach_comment']."', '$attachext', '".$attachment['attach_size']."')"); 
     851                        $result = dbquery("INSERT INTO ".$db_prefix."forum_attachments (thread_id, post_id, attach_name, attach_realname, attach_comment, attach_ext, attach_size) VALUES ('$thread_id', '$post_id', '".mysql_real_escape_string($attachname)."', '".mysql_real_escape_string($attachment['attach_name'])."', '".mysql_real_escape_string($attachment['attach_comment'])."', '$attachext', '".$attachment['attach_size']."')"); 
    811852                    } 
    812853                } 
     
    10201061            $variables['prefixes'] = array(); 
    10211062            foreach ($prefixes as $prefix) { 
    1022                 if (!empty($prefix)) $variables['prefixes'][] = trim($prefix); 
     1063                $prefix = trim($prefix); 
     1064                if (!empty($prefix)) $variables['prefixes'][] = $prefix; 
    10231065            } 
    10241066            if (!isset($title)) $title = $locale['415']." #".$reply_id; 
     
    10441086            } elseif ($post_id > 0 || $reply_id > 0) { 
    10451087                $subject = $pdata['post_subject']; 
    1046                 // split the subject to check for a prefix 
    1047                 if (preg_match('~(.*)\[(.*)\](.*)~', $subject, $matches)) 
    1048                 { 
    1049                     // update the subject, set the prefixes 
    1050                     $subject = trim($matches[3]); 
    1051                     $variables['prefix'] = $matches[2]; 
    1052                     $variables['new_prefix'] = '['.$matches[2].']'; 
    1053                 } 
    1054                 if ($action != "newthread" && strtolower(substr($subject,0,3)) != "re:") { 
     1088                if (!in_array($action, array("edit","newthread")) && strtolower(substr($subject,0,3)) != "re:") { 
    10551089                    $variables['subject'] = 'Re: '.$subject; 
    10561090                } else { 
     
    10881122                $bbcolor = ""; 
    10891123            } 
     1124            // do we need to deal with a subject prefix 
     1125            if (!isset($variables['prefix'])) { 
     1126                $sparray = strip_prefix($variables['subject']); 
     1127 
     1128                $variables['subject'] = $sparray['subject']; 
     1129                // check if it's a custom prefix 
     1130                if (in_array($sparray['prefix'],$variables['prefixes'])) { 
     1131                    $variables['prefix'] = $sparray['prefix']; 
     1132                    $variables['new_prefix'] = '['.$sparray['prefix'].']'; 
     1133                } else { 
     1134                    if (empty($sparray['prefix'])) { 
     1135                        $variables['prefix'] = ''; 
     1136                        $variables['new_prefix'] = '[?]'; 
     1137                    } else { 
     1138                        $variables['prefix'] = '?'; 
     1139                        $variables['new_prefix'] = '['.$sparray['prefix'].']'; 
     1140                    } 
     1141                } 
     1142            } 
     1143 
    10901144            // process attachments 
    10911145            if ($settings['attachments'] == "1" && $fdata['forum_attach'] == "1") { 
  • branches/PLi-Fusion/includes/ajax.response.php

    r2166 r2364  
    8989        // make sure we have json_encode and json_decode available 
    9090        require_once "json_include.php"; 
     91        header("Content-Type:application/json; charset=utf-8"); 
    9192        if (iMEMBER) { 
    9293            // return the user record datastore 
     
    104105            } 
    105106        } 
     107        break; 
     108    case "counters": 
     109        if (!iMEMBER) { 
     110            $pms = $posts = 0; 
     111            $pmtext = $posttext = ""; 
     112        } else { 
     113            $pms = dbcount("(pmindex_id)", "pm_index", "pmindex_user_id='".$userdata['user_id']."' AND pmindex_to_id='".$userdata['user_id']."' AND pmindex_read_datestamp = '0'"); 
     114            if ($pms == 1) { 
     115                $pmtext = sprintf($locale['085'], $pms); 
     116            } else { 
     117                $pmtext = sprintf($locale['086'], $pms); 
     118            } 
     119            if ($userdata['user_posts_unread']) { 
     120                $result = dbquery(" 
     121                    SELECT count(*) as unread 
     122                        FROM ".$db_prefix."posts p 
     123                            INNER JOIN ".$db_prefix."forums f ON p.forum_id = f.forum_id 
     124                            INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     125                        WHERE ".groupaccess('f.forum_access')." 
     126                            AND tr.user_id = '".$userdata['user_id']."' 
     127                            AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 
     128                            AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 
     129                                OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 
     130                    ); 
     131            } else { 
     132                $result = dbquery(" 
     133                    SELECT count(*) as unread 
     134                        FROM ".$db_prefix."posts p 
     135                            INNER JOIN ".$db_prefix."forums f ON p.forum_id = f.forum_id 
     136                            INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     137                        WHERE ".groupaccess('f.forum_access')." 
     138                            AND tr.user_id = '".$userdata['user_id']."' 
     139                            AND p.post_author != '".$userdata['user_id']."' 
     140                            AND p.post_edituser != '".$userdata['user_id']."' 
     141                            AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 
     142                            AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 
     143                                OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 
     144                    ); 
     145            } 
     146            $posts = ($result ? mysql_result($result, 0) : 0); 
     147            if ($posts == 1) { 
     148                $posttext = sprintf($locale['088'], $posts); 
     149            } else { 
     150                $posttext = sprintf($locale['089'], $posts); 
     151            } 
     152        } 
     153        // make sure we have json_encode and json_decode available 
     154        require_once "json_include.php"; 
     155        // send the results back 
     156        header("Content-Type:application/json; charset=utf-8"); 
     157        echo json_encode(array('pmcount' => $pms, 'pmtext' => $pmtext, 'postcount' => $posts, 'posttext' => $posttext)); 
    106158        break; 
    107159    case "pm": 
     
    211263    mysql_close(); 
    212264} 
    213 ?> 
  • branches/PLi-Fusion/includes/jscripts/core_functions.js

    r2301 r2364  
    104104        } 
    105105    } 
     106} 
     107 
     108// return a new AJAX object 
     109function asyncajaxcall() { 
     110    var result = false; 
     111    if (window.XMLHttpRequest) { 
     112        // For Safari, Firefox, and other non-MS browsers 
     113        try { 
     114            result = new XMLHttpRequest(); 
     115        } catch (e) { 
     116            result = false; 
     117        } 
     118    } else if (window.ActiveXObject) { 
     119        // For Internet Explorer on Windows 
     120        try { 
     121            result = new ActiveXObject("Msxml2.XMLHTTP"); 
     122        } catch (e) { 
     123            try { 
     124                result = new ActiveXObject("Microsoft.XMLHTTP"); 
     125            } catch (e) { 
     126                result = false; 
     127            } 
     128        } 
     129    } 
     130    return result; 
    106131} 
    107132 
  • branches/PLi-Fusion/includes/secureimage-1.0.3/securimage.php

    r1986 r2364  
    1818 * License along with this library; if not, write to the Free Software 
    1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA<br /><br /> 
    20  *  
    21  * Any modifications to the library should be indicated clearly in the source code  
     20 * 
     21 * Any modifications to the library should be indicated clearly in the source code 
    2222 * to inform users that the changes are not a part of the original software.<br /><br /> 
    2323 * 
     
    121121  var $charset = 'ABCDEFGHKLMNPRSTUVWYZ23456789'; 
    122122  //var $charset = '0123456789'; 
    123    
     123 
    124124  /** 
    125125   * Create codes using this word list 
     
    128128   */ 
    129129  var $wordlist_file = ''; 
    130    
     130 
    131131  /** 
    132132   * True to use a word list file instead of a random code 
     
    363363  var $audio_path = './audio/'; 
    364364 
     365  /** 
     366   * Captcha expiry timeout in seconds. 
     367   * 
     368   * @since 1.0.3 
     369   * @var string 
     370   */ 
     371  var $timeout = 300; 
     372 
     373 
    365374 
    366375  //END USER CONFIGURATION 
     
    423432      die('no session available!'); 
    424433    } 
    425      
     434 
    426435    // we use random colors to make it even more difficult 
    427436    $this->image_bg_color = $this->getHexColor(); 
     
    445454    return $clr; 
    446455  } 
    447     
     456 
    448457  /** 
    449458   * Generate a code and output the image to the browser. 
     
    693702  { 
    694703    $this->code = false; 
    695      
     704 
    696705    if ($this->use_wordlist && is_readable($this->wordlist_file)) { 
    697706      $this->code = $this->readCodeFromFile(); 
    698707    } 
    699      
     708 
    700709    if ($this->code == false) { 
    701710      $this->code = $this->generateCode($this->code_length); 
    702711    } 
    703      
     712 
    704713    $this->saveData(); 
    705714  } 
     
    721730    return $code; 
    722731  } 
    723    
     732 
    724733  /** 
    725734   * Reads a word list file to get a code 
     
    733742    $fp = @fopen($this->wordlist_file, 'r'); 
    734743    if (!$fp) return false; 
    735      
     744 
    736745    $fsize = filesize($this->wordlist_file); 
    737746    if ($fsize < 32) return false; // too small of a list to be effective 
    738      
     747 
    739748    if ($fsize < 128) { 
    740749      $max = $fsize; // still pretty small but changes the range of seeking 
     
    742751      $max = 128; 
    743752    } 
    744      
     753 
    745754    fseek($fp, rand(0, $fsize - $max), SEEK_SET); 
    746755    $data = fread($fp, 128); // read a random 128 bytes from file 
    747756    fclose($fp); 
    748      
     757 
    749758    $start = strpos($data, "\n", rand(0, 100)) + 1; // random start position 
    750759    $end   = strpos($data, "\n", $start) - 1; // find end of word 
    751      
     760 
    752761    return strtolower(substr($data, $start, $end - $start)); // return substring in 128 bytes 
    753762  } 
     
    822831  { 
    823832    $_SESSION['securimage_code_value'] = strtolower($this->code); 
     833    $_SESSION['securimage_code_timestamp'] = time(); 
    824834  } 
    825835 
     
    834844    if ( isset($_SESSION['securimage_code_value']) && !empty($_SESSION['securimage_code_value']) ) { 
    835845      if ( $_SESSION['securimage_code_value'] == strtolower(trim($this->code_entered)) ) { 
    836         $this->correct_code = true; 
    837         $_SESSION['securimage_code_value'] = ''; 
     846        if (isset($_SESSION['securimage_code_timestamp']) && (time() - $_SESSION['securimage_code_timestamp']) < $this->timeout) { 
     847          $this->correct_code = true; 
     848          $_SESSION['securimage_code_value'] = ''; 
     849        } else { 
     850          $this->correct_code = false; 
     851        } 
    838852      } else { 
    839853        $this->correct_code = false; 
     
    906920      $file['size']            = $data['ChunkSize'] + 8; 
    907921      $file['data']            = $body; 
    908        
     922 
    909923      if ( ($p = strpos($file['data'], 'LIST')) !== false) { 
    910924        // If the LIST data is not at the end of the file, this will probably break your sound file 
     
    914928        $file['size'] = $file['size'] - (strlen($file['data']) - $p); 
    915929      } 
    916        
     930 
    917931      $files[] = $file; 
    918932      $data    = null; 
  • branches/PLi-Fusion/includes/session_functions.php

    r2232 r2364  
    4848 
    4949// update the timestamp of the session cookie, we want expiry after the last page load, not after the session has started! 
    50 setcookie(ini_get("session.name"), session_id(), time()+ini_get("session.gc_maxlifetime"), "/"); 
     50setcookie(ini_get("session.name"), session_id(), time()+$settings['session_gc_maxlifetime'], "/"); 
    5151 
    5252// store the last_url cookie if found 
  • branches/PLi-Fusion/includes/templates/admin.forums.tpl

    r2342 r2364  
    6565            <tr> 
    6666                <td colspan='2' class='tbl'> 
     67                    <input type='checkbox' name='forum_prefix' value='1' onchange='togglefields("prefixes");'{if $forum_prefix} checked="checked"{/if} /> {$locale.495} 
     68                </td> 
     69            </tr> 
     70            <tr id='prefixes'{if !$forum_prefix} style='display:none'{/if}> 
     71                <td colspan='2' class='tbl'> 
    6772                    {$locale.494} 
    6873                    <br /> 
     
    145150            <tr> 
    146151                <td colspan='2' class='tbl'> 
    147                     <input type='checkbox' name='forum_attach' value='1' onchange='togglefields();'{if $forum_attach} checked="checked"{/if} /> {$locale.469} 
     152                    <input type='checkbox' name='forum_attach' value='1' onchange='togglefields("attachtypes");'{if $forum_attach} checked="checked"{/if} /> {$locale.469} 
    148153                </td> 
    149154            </tr> 
     
    167172    </form> 
    168173{literal}<script type='text/javascript'> 
    169 function togglefields() { 
     174function togglefields(name) { 
    170175    if(navigator.appName.indexOf('Microsoft') > -1) { 
    171176        state = 'block'; 
     
    173178        state = 'table-row'; 
    174179    } 
    175     if (document.getElementById('attachtypes').style.display == 'none') { 
    176         document.getElementById('attachtypes').style.display = state; 
     180    if (document.getElementById(name).style.display == 'none') { 
     181        document.getElementById(name).style.display = state; 
    177182    } else { 
    178         document.getElementById('attachtypes').style.display = 'none'; 
     183        document.getElementById(name).style.display = 'none'; 
    179184    } 
    180185} 
  • branches/PLi-Fusion/includes/templates/forum.index.tpl

    r2346 r2364  
    151151            {buttonlink name=$locale.415 link="tracking.php"} 
    152152            {buttonlink name=$locale.414 link="viewposts.php"}<br /> 
    153             <form name='searchform' method='post' style="margin-top:2px;" action='{$smarty.const.BASEDIR}search.php?stype=f'> 
     153            <form name='searchform' method='post' style="margin-top:2px;" action='{$smarty.const.BASEDIR}search.php?action=search'> 
    154154                <input type='text' name='stext' class='textbox' style='width:150px' /> 
     155                <input type='hidden' name='boolean' value='1' /> 
     156                <input type='hidden' name='qtype' value='AND' /> 
     157                <input type='hidden' name='search_id' value='3.2' /> 
     158                <input type='hidden' name='sortby' value='datestamp' /> 
     159                <input type='hidden' name='order' value='0' /> 
     160                <input type='hidden' name='limit' value='0' /> 
     161                <input type='hidden' name='datelimit' value='0' /> 
     162                <input type='hidden' name='contentfilter_users' value='0' /> 
     163                <input type='hidden' name='contentfilter_forums' value='0' /> 
    155164                <input type='submit' name='search' value='{$locale.550}' class='button' /> 
    156165            </form> 
  • branches/PLi-Fusion/includes/templates/forum.post.tpl

    r2348 r2364  
    124124            <td> 
    125125                <table width='100%' border='0' cellspacing='1' cellpadding='0'> 
    126                     <tr> 
     126                    <tr {if $forum.forum_prefix == 0}style="display:none;"{/if}> 
    127127                        <td align='right' width='145' valign='top' class='tbl2'> 
    128128                            {$locale.533}: 
    129129                        </td> 
    130130                        <td class='tbl1'> 
    131                             <select name="prefix" class="textbox" style="width:125px;" onChange="javascript:update_prefix(this);"> 
    132                                 <option value="">{$locale.534}</option> 
     131                            {assign var=show_prefix value=0} 
     132                            <select name="prefix" class="textbox" style="width:125px;" onChange="update_prefix(this);"> 
     133                                <option value="" {if $prefix == ""}selected="selected"{/if}>{$locale.534}</option> 
    133134                            {foreach from=$prefixes item=post_prefix} 
    134135                                <option value="{$post_prefix}" {if $prefix == $post_prefix}selected="selected"{/if}>{$post_prefix}</option> 
    135136                            {/foreach} 
    136                                 <option value="?">{$locale.535}</option> 
     137                                <option value="?" {if $prefix == "?"}selected="selected"{assign var=show_prefix value=1}{/if}>{$locale.535}</option> 
    137138                            </select> 
    138                             <input type='text' id="new_prefix" name='new_prefix' value='{$new_prefix}' class='textbox' maxlength='255' style='width: 250px' disabled="disabled" /> 
     139                            <input type='text' id="new_prefix" name='new_prefix' value='{$new_prefix}' class='textbox' maxlength='255' style='width: 250px;{if $show_prefix ==0}display:none;{/if}' /> 
    139140                        </td> 
    140141                    </tr> 
     
    150151                    <tr> 
    151152                        <td align='right' width='145' class='tbl2' valign='top' style='white-space:nowrap'> 
    152                             <input type='submit' class='button' name='toggle_msg' value='{$locale.474}' onclick='javascript:flipDiv("org_message");return false;' /> 
     153                            <input type='submit' class='button' name='toggle_msg' value='{$locale.474}' onclick='flipDiv("org_message");return false;' /> 
    153154                        </td> 
    154155                        <td class='tbl1'> 
     
    194195                    <tr> 
    195196                        <td align='right' width='145' valign='top' class='tbl2'> 
    196                             <input type='button' name='toggle' class='button' value='{$locale.467}' onclick='javascript:loadSmileys("smileys", "smileys_loaded", "{$smarty.const.BASEDIR}includes/ajax.response.php?request=smileys&parms=message");return false;' /> 
     197                            <input type='button' name='toggle' class='button' value='{$locale.467}' onclick='loadSmileys("smileys", "smileys_loaded", "{$smarty.const.BASEDIR}includes/ajax.response.php?request=smileys&parms=message");return false;' /> 
    197198                        </td> 
    198199                        <td class='tbl1'> 
     
    266267                                <input type='submit' name='upload' value='{$locale.471}' class='button' /> 
    267268                            {else} 
    268                                 <input type='submit' name='upload' value='{$locale.471}' class='button' onclick='javascript:get_hoteditor_data("message");' /> 
     269                                <input type='submit' name='upload' value='{$locale.471}' class='button' onclick='get_hoteditor_data("message");' /> 
    269270                            {/if} 
    270271                        </td> 
     
    309310                                <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' /> 
    310311                            {else} 
    311                                 <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' onclick='javascript:get_hoteditor_data("message");' /> 
     312                                <input type='submit' name='fpm[add_options]' class='button' value='{$locale.FPM_104}' onclick='get_hoteditor_data("message");' /> 
    312313                            {/if} 
    313314                        {/if} 
     
    380381                    <input type='submit' name='save' value='{$button_save}' class='button' /> 
    381382                {else} 
    382                     <input type='submit' name='preview' value='{$button_preview}' class='button' onclick='javascript:document.getElementById("new_prefix").disabled = false;get_hoteditor_data("message");' /> 
    383                     <input type='submit' name='save' value='{$button_save}' class='button' onclick='javascript:document.getElementById("new_prefix").disabled = false;get_hoteditor_data("message");' /> 
     383                    <input type='submit' name='preview' value='{$button_preview}' class='button' onclick='get_hoteditor_data("message");' /> 
     384                    <input type='submit' name='save' value='{$button_save}' class='button' onclick='get_hoteditor_data("message");' /> 
    384385                {/if} 
    385386                <input type='hidden' name='post_author' value='{$post_author}' /> 
     
    413414    if ( el.value == "?") { 
    414415        document.getElementById('new_prefix').value = "[?]"; 
    415         document.getElementById('new_prefix').disabled = false; 
     416        document.getElementById('new_prefix').style.display = 'inline'; 
    416417        document.getElementById('new_prefix').focus = true; 
    417418    }   else { 
    418         document.getElementById('new_prefix').disabled = true; 
     419        document.getElementById('new_prefix').style.display = 'none'; 
    419420        if ( el.value == "") { 
    420421            document.getElementById('new_prefix').value = ""; 
Note: See TracChangeset for help on using the changeset viewer.