Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26,926 through 26,950 (of 32,481 total)
  • Author
    Search Results
  • #67406

    In reply to: Server Overload

    _ck_
    Participant

    No the zen optimizer is not an opcode cache, it’s just another keyhole optimizer. eAccelerator has a keyhole optimizer too but it doesn’t hurt anything to use them both. I use them both on PHP4 servers, PHP5 doesn’t need it.

    I think there are possibly THREE (simple) problems.

    One is a leftover corrupted eaccelerator cache left on your drive from a previous attempt that has to be cleared/deleted first.

    Two is an old eaccelerator that was built for a different version of PHP, it needs to be rebuilt with that script above.

    The last possibility might be the extension load order.

    (you can try disabling the zend optimizer altogether as it’s overkill when eaccelerator is running)

    So:

    1. Try deleting your old eaccelerator disk cache first

    rm -rf /tmp/eaccelerator

    2. Go into php.ini and look for the Zend section.

    It will look something like this but maybe not exactly like this:

    [Zend]
    zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.0.1
    zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.0.1
    zend_optimizer.version=3.0.1
    zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
    zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

    3. Make sure that Zend section is ABOVE (before) the eAccelerator section. You can also try commenting it all out with semi-colons before each line to disable it entirely.

    Last but not least, you should also delete the entire eAccerator section in PHP.ini and then run that script above.


    After thinking about this for awhile, I would put my money on the idea that your eAccelerator was built for an earlier version of PHP and MUST be re-compiled by that script.

    #67404

    In reply to: Server Overload

    _ck_
    Participant

    If you replaced the semi-colon and it still will not restart, you need to double check for a typo.

    Failing that, you can try removing all lines starting with eaccelerator. which should be at the very end of the php.ini or just putting semi-colons in front of them.

    I perhaps should have told you to make a copy of php.ini via cp php.ini php.bak but since it’s documented here we should be able too repair it.

    Actually, that install script probably made a backup of php.ini for you. Update: no unfortunately it does that when it’s about to copy and it didn’t make it that far. But you may have backup copies from other programs. See what files show up when you do a ls php* -latr

    #3960

    Topic: Papercraftmuseum.com

    in forum Showcase
    haagendazs1
    Member

    Hi,

    I reskinned a previous bbPress install to match the look of another site. Check it out:

    main site is http://www.papercraftmuseum.com/

    bbPress is at http://www.papercraftmuseum.com/pcmforum/

    I reskinned my other bbPress from http://dreampush.com/forums/

    notice the similarity? ;)

    #67444

    In reply to: Topic action hook

    thion
    Member

    All right, let’s try different question – I want to add additional informations to topicmeta when posting new topic – how can I achieve this? :)

    Or at least point me to a plugin that is doing something like this so I could learn there…

    #67423
    cartmanffc
    Member

    changes I made were related to the info being repeated twice and I was messing with the code to get the graphic bar working

    I somehow worked out the first problem and the latest version of Karma plugin (0.0.5) solved the second problem so now everything is working perfectly

    thank you for the update of the plugin and quick response

    #67467

    In reply to: Accents in username

    Amir Habibi
    Member

    Thanks for your replies. After reading / testing your links, I found a quick working fix. Here’s the plugin code :

    <?php
    /*
    Plugin Name: UTF-8 usernames
    Plugin URI:
    Description: This plugin enable utf-8 characters in usernames. Mbstring must be enabled in the php.ini.
    Author: Amir Habibi
    Author URI: http://www.residence-mixte.com/
    Version: 0.1
    */

    function sanitize_user_mbstring( $raw_username, $username, $strict = false ) {
    $raw_username = $username;
    $username = strip_tags($username);
    // Kill octets
    $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
    $username = preg_replace('/&.+?;/', '', $username); // Kill entities

    // Usage of 'mb_ereg_replace' instead of 'preg_replace' to preserve accents.
    if ( $strict )
    $username = mb_ereg_replace('|[^a-z0-9 _.-@]|i', '', $username);

    return apply_filters('sanitize_user_mbstring', $username, $raw_username, $strict);

    }

    add_action('sanitize_user', 'sanitize_user_mbstring', 0, 3);
    ?>

    To work, you must have mstring enabled in your php.ini.

    Hope this will help !

    chrishajer : our board is in french

    #67482

    In reply to: hack help

    chrishajer
    Participant

    There is no author rank in the default installation. Are you talking about their title (like Member or Administrator)?

    If so, you would need to modify the template file for each place where the title appears (maybe it’s only on the topic pages, for each post?) If so, just remove it from the post.php file in your template directory:

    Remove this line:

    <small><?php post_author_title(); ?></small>

    That removes the author title from under the author’s name. If that’s not what you mean, then you have something installed that I do not. I think there is a post rating plugin and an author reputation (karma) plugin: maybe one of those is showing the rank you’re talking about.

    #67402

    In reply to: Server Overload

    _ck_
    Participant

    OH! You know what my tired eyes missed?

    Yes, you have the eAccelerator *settings*,

    BUT it’s disabled!

    Someone disabled it by putting a semi-colon in front of the actual binary:

    ;extension="eaccelerator.so"

    See that? To enable it, the semi-colon has to be removed, otherwise it’s dormant.

    Now if it wasn’t properly installed and the setting were just left in place, then removing the semi-colon may just halt PHP entirely and prevent your apache from working correctly.

    So try removing the semi-colon, save php.ini and then restart Apache via: service httpd restart

    If apache doesn’t restart, or it does but you can’t access web pages, then you need to go put back the semi-colon or remove the eaccelerator section entirely.

    If apache starts but you can’t find an “eaccelerator” section inside phpinfo() then it’s not really installed, or installed incorrectly. If that’s the case, then you need to remove all the existing eaccelerator lines listed above, and then run that install script again.

    By the way, if you don’t know what phpinfo() is, just make a file called phpinfo.php and put only this line into it: <?php phpinfo(); ?> and put it somewhere you can access it from the web on your server and then access it via the web.

    You will definitely see a speed boost when reloading pages once eAccelerator is properly installed and running.

    #67401

    In reply to: Server Overload

    _ck_
    Participant

    I probably made a bad assumption that it was not installed, though it definitely doesn’t come by default on a cpanel setup so that’s a bit unusual. Strange someone would put eaccelerator on there but not enable the mysql cache.

    You can look at your phpinfo() to find out if eAccelerator is really installed and active.

    That eaccelerator compress and compression level is just a waste of cpu time. I’d either set

    eaccelerator.compress="0"

    or

    eaccelerator.compress_level="1"

    By the way, the php configuration is located in

    /usr/local/lib/php.ini

    and the eAccelerator options are at the very bottom of the file if you ever have to manually edit them.

    #3958

    Topic: hack help

    in forum Installation
    doyle640
    Member

    does anyone know where (in what file) I would delete the code that displays the author’s rank in each post?

    thanks for any help.

    #3955
    wiggster
    Member

    Just a small cosmetic issue I noticed after installing the Version 1.0-alpha-1 zip file: after activating a few plugins, I noticed that the cells were not alternating classes correctly (or at least, what I’d think of as correctly).

    To test this, simply go to the Plugins page and activate a plugin. If the plugin row had a white background, it changes to green to show it’s active. If it had a gray background, it stays gray whether it is active or not. It seems to me that we’d want there to be either one or two shades of green to show the active plugins.

    The cause between this seems to be the CSS classes of the active rows alternated between <tr class="active"> and <tr class="active alt">; this means that the row with ‘active alt’ takes the properties of the ‘alt’ row, which overrides the background color of the ‘active’ class as it is lower in the style.css template. This derives from the function get_alt_class(), as defined in bb-includes/template-functions.php, which can assign two classes to one element.

    #65189
    Detective
    Member

    Well, i don’t know :p You need to provide me with better information, like: do you uploaded the plugin into the folder my-plugins ?

    Perhaps you didn’t uncompress the folder sack ??

    #3952

    Topic: Topic action hook

    in forum Plugins
    thion
    Member

    I was looking, but can’t find – so I’m still looking for hook, something like this:

    add_action('profile_edited', 'update_user_socialize');

    Above hook is used to add usermeta when editing profile – I’m looking for something that would add additional topicmeta when posting new topic – the following is not working:

    add_action('post_topic', 'post_new_job');

    So is there any hook like this?

    #67442
    _ck_
    Participant
    Database error: []
    SELECT * FROM bb_online WHERE user_id = LIMIT 1
    Caller: online_logout

    The user_id is empty in this case which causes the error.

    The question is why it’s empty.

    This could be a cookie problem, this could be an alpha bug.

    If you have no plugins running and switching to the default template does not make the error go away, it’s a bug and should be reported on TRAC (along with your configuration if possible, server type, PHP, etc)

    #67441
    _ck_
    Participant

    “Cannot modify header information – headers already sent”

    is one of those errors that will fool you by distraction because it’s an indication of another error, that happened before it, it’s not the actual primary error.

    “headers already sent” means one of the following (among other possibilities)

    1. You have whitespace at the start of end of a plugin (or template) BEFORE or AFTER the <?php ?> (usually after the end. Whitespace means new lines or spaces.

    OR

    2. Another plugin or configuration error has occured and sends a text message, which causes the headers to be sent. To find out what the real problem is, you typically can do a “VIEW SOURCE” on the page (from your browser menus) and you’ll see in plain text at the top of the page the real error before the “headers sent” error.

    #3949
    lstelie
    Member

    Hello,

    I wrote this for my own use, in case it could be of some use for someone, here it is :

    http://pastebin.com/f35e5dcbe

    This allow to put some html code in header (or example metatags) and footer (for example counter code)

    There is no admin part for two reasons :

    1) I’m learnig how it works

    2) I’m not sure it would be a great idea to have a DB request for a code that never change

    So for instance you’ll have to edit manually the plugin file

    Why use a plug in instead of a direct ad in the template ? because for alpha release the default template (my own is based on kakumei) sometimes change, so keeping the personal code updated each time can be tedious.

    Luc

    #67398

    In reply to: Server Overload

    _ck_
    Participant

    By the way, once you are done with this, we’ll install eAccelerator and that will give your PHP a nice boost too.

    Let me know how the MySQL cache mod goes.

    If you don’t want to wait and feel comfortable trying it right away, try downloading and using this script to auto-install eAccelerator on Cpanel:

    wget http://tutorials.medialayer.com/cPanel/eaccelerator.sh
    chmod 700 eaccelerator.sh
    ./eaccelerator.sh

    Once it is done, you might have to restart apache

    service httpd restart

    and you should definitely notice another speed boost.

    #67435

    In reply to: expired topics

    _ck_
    Participant

    Untested. auto-closes a topic on-the-fly when someone visits it and it’s last post is 90 days old (adjustable)

    add_action('bb_head','auto_close_topic');
    function auto_close_topic() {
    global $topic;
    if (is_topic() && $topic->topic_open===1) {
    $old=time()-3600*24*90; // 90 days default
    if (strtotime($topic->topic_time)<$old) {
    bb_close_topic($topic->topic_id);
    $topic->topic_open=0; // just in case the cache doesn't clear
    }
    }
    }

    #67395

    In reply to: Server Overload

    _ck_
    Participant

    Okay, carefully edit your /etc/my.cnf (ask if you don’t know how to edit) and REPLACE what’s in there with this:

    [mysqld]
    max_connections = 400
    key_buffer = 16M
    myisam_sort_buffer_size = 32M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 286
    interactive_timeout = 25
    wait_timeout = 1000
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    query_cache_limit = 1M
    query_cache_size = 16M
    query_cache_type = 1
    tmp_table_size = 16M
    skip-innodb
    [mysqld_safe]
    open_files_limit = 8192
    [mysqldump]
    quick
    max_allowed_packet = 16M
    [myisamchk]
    key_buffer = 32M
    sort_buffer = 32M
    read_buffer = 16M
    write_buffer = 16M
    [mysqlhotcopy]
    interactive-timeout

    After you edit it you’ll need to restart the mysql engine by typing this in the ssh:

    service mysql restart

    (optionally there’s also a mysql restart in cpanel)

    Then do a couple of refreshes on your bbPress pages and it should seem a bit zippier.

    #67392

    In reply to: Server Overload

    lstelie
    Member

    _ck_

    In latest bb-config.php there is no /* Stop editing */

    Do I put $bb->load_options = true; at the end of the file ?

    #65186
    meitershaker
    Member

    same problem here :)

    #67382
    meitershaker
    Member

    $hidden_forums=array(10); // hide these forums, list by comma seperated number

    $hidden_forums=array(‘keymaster’,’administrator’,’moderator’); // these roles can always see ALL forums regardless

    $hidden_forums[500]=array(‘administrator’,’moderator’); // exact formal role name, *not* ability

    $hidden_forums[501]=array(‘administrator’,’moderator’); // exact formal role name, *not* ability

    $hidden_forums=array(1); // these users can always see ALL forums regardless

    $hidden_forums[500]=array(5432,7654); // list of users by number

    $hidden_forums[501]=array(5432,7654); // list of users by number

    $hidden_forums=””; // text, html, css or image to indicate hidden forums/topics, make it =””; if you don’t want any label at all

    #67381
    _ck_
    Participant

    Well it works for me.

    Show me your configuration inside hidden-forums.php and how many forums do you have?

    Are those queries happening on the front-page, forum-page or topic-page?

    #56181

    In reply to: Quote Plugin Weirdness

    cartmanffc
    Member

    Where exactly should I put this code in post-form.php?

    <textarea name=”post_content” cols=”50″ rows=”8″ id=”post_content” tabindex=”3″>

    <?php if (function_exists(‘bb_quote_post’)) bb_quote_post(); ?>

    </textarea>

    #3943
    cartmanffc
    Member

    I thought it might be helpful; I tried the following popular plugins with the latest release of bbPress and they seem to work perfectly:

    – bb-smilies

    – bbcode-buttons

    – mini-track

    – my-views

    – post-count-plus (with some minor changes)

    – support-forum

    – bb-reputation (to some extent)

    – bb-signatures

    – bb-topic-views

    – bbcode-lite

    – hidden-forums

    – report-post

    – unread-posts

    what is missing most is the working plugin for quotes…

Viewing 25 results - 26,926 through 26,950 (of 32,481 total)
Skip to toolbar