Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,476 through 29,500 (of 32,491 total)
  • Author
    Search Results
  • #59580
    _ck_
    Participant

    I should point out that even your static.html serves up fairly slowly, though a little faster than the dynamic pages. Getting mysql caching may not be as big a boost as it hopefully should be. I can’t even see what your guaranteed VPS ram is.

    If you are on a VPS there is usually a seperate VPS control panel that will also let you restart services, including mysql.

    my setup lets me do a “service mysql restart” but that’s probably not universal. This is what I have in my.cnf

    [mysqld]

    # myisam-recover = BACKUP
    # delay-key-write = ALL

    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
    old-passwords = 1
    basedir = /var/lib/mysql
    datadir = /var/lib/mysql
    long_query_time = 1
    log-slow-queries = /var/log/mysql/mysql-slow.log
    log-error = /var/log/mysql/mysqld.err

    [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

    #50216
    fel64
    Member

    The first line of the first post? Or do you mean the first thread in the first thread listing?

    Sure, just do something like this. <?php if( !$is_foist_topic ) { echo ‘ class=”first-topic”‘; $is_foist_topic = true; } ?>

    The first time it checks it won’t be true, so it echoes code to change the class of the HTML. Then it sets it to true, so the next times it will be true and it’ll skip that.

    You want the code to set the class of the tr I believe, so put it in the HTML for that. Play around.

    #58872
    fel64
    Member

    I mailed mdawaffe in the mailing list but no response. He knows and I assume he’s working on it, or going to.

    #52665
    citizenkeith
    Participant

    Thanks fel! :) In the meantime, I’ll just edit HTML special characters in my user’s signatures.

    #58871
    outchy
    Member

    yeah this is happening for me too. any luck?

    #52664
    fel64
    Member

    By having ck stripslashes on it. It seems to be something he’s gotta fix.

    None of these are dumb questions … just ask ’em and don’t worry about it. :)

    #52663
    citizenkeith
    Participant

    Thanks guys, I figured it out. :D

    Dumb Question #2: How does one use quotes or apostrophes in their signatures? Forward slashes are inserted before each instance.

    #59590

    In reply to: Limit long words

    fel64
    Member

    You want

    .post { overflow: auto; }

    which isn’t actually the automatic setting – but it’s the one that automatically adds a scrollbar if the post is too wide. Like multiline code here, it’ll add the scrollbar only if needed. Also handy for images.

    And lol at everyone suggesting something else. :P

    #52950
    chrishajer
    Participant

    I think the real question here is “what the heck is a winesap”?

    :D

    #59589

    In reply to: Limit long words

    bobbyh
    Member

    It sounds like you’re looking for something like the proprietary word-wrap CSS property which works in IE browsers only, as far as I know.

    .post {word-wrap: break-word; }

    #59576
    chrishajer
    Participant

    If you have shell access, I imagine you would have access to top ? My guess is the load on the server is pretty crazy, with lots of sites hosted there.

    edit: just read where you don’t have top in your path. Hmm. But you have access to my.cnf? That’s odd.

    #59586

    In reply to: Limit long words

    bobbyh
    Member

    Yeah, the easy fix for this is adding:

    .post {overflow: hidden; }

    #57812
    MaryJane
    Member

    I cant get this theme downloaded. All thats in the download link is a text file and its not wrote in english so i dont know what it says. :-(

    #59572
    _ck_
    Participant

    Well its a P4 (single core) @ 3ghz with 4gb of ram.

    The question is how many clients is it hosting, and since you have your own ip, there’s no real way to determine that.

    It’s taking almost a full second for 9 queries. Something is very, very, very wrong. You might want to enquire. If you do have access to /etc/my.cnf, you can turn on the mysql query cache and that should cause a radical improvement.

    Not related to the mysql speed but just in general, any external javascript that you don’t need to execute immediately on a page, you should add the word DEFER to it. There are two flickr scripts you should try adding it to, if it still works with it in both IE and Firefox, it will make your pages seem a little faster.

    ie.

    <script DEFER type="text/javascript" ...blah...blah

    Last but not least if they can’t fix it, you can do better for your almost $150 a year.

    #51582
    outchy
    Member

    yes, good call:

    <?php
    $latestpost = $bbdb->get_row("
    SELECT *
    FROM $bbdb->posts
    WHERE post_status = 0

    ORDER BY post_time DESC
    LIMIT 1

    ");
    ?>

    Re:
    <a href="<?php echo get_topic_link($latestpost->topic_id); ?>"><?php echo get_topic_title($latestpost->topic_id); ?></a>:<br /><br />

    <a href="<?php user_profile_link($latestpost->poster_id); ?>"><?php echo get_user_name($latestpost->poster_id); ?></a> said:

    <?php echo $latestpost->post_text; ?>

    #59547
    howtogeek
    Member

    Just thought I’d throw this out there… if you want to put the two new views first in the list, you can first unset the existing view, and then re-set it below where you add the new views.

    unset($views);

    if (bb_is_user_logged_in()) {

    $views = "Topics I've Started";

    $views = "Topics I've Participated In";

    }

    $views = "Topics with no replies";

    You can also rename the view that way if you want.

    #52949
    riddle
    Member

    I managed to hack the breadcrumbs code in Kakumei to properly show one level of subforums. I’m not yet a plugin hacker, nor am I sure whether this sort of cosmetic tinkering can be handled by plugins as opposed to editing the themes, but if anybody’s interested I can try to extract enough fragments to help you get started retracing my steps.

    #59569
    _ck_
    Participant

    Page transfer time alone was not-so-hot.

    Front page, non-cached, no-images, no external js/css was 2.84 seconds. Loading a fresh topic took over 6 seconds in my browser.

    No gzip web compression enabled.

    PHP5 (~10%+ slower than PHP4)

    There’s definitely no mysql cache – way, way too slow.

    Can you put make yourself a phpinfo.php page and put <? phpinfo(); ?> in there for us to check for other stuff? I don’t think it’s a security issue but others will have to agree or not.

    Another neat way to look at unknown servers is with this perlinfo cgi I found and hacked at a bit a few years ago. Rename that to perlinfo.cgi upload to your cgi-bin and chmod it to 755. Then we can maybe see a bit more. If you don’t know how to do all this, then nevermind.

    I need at least one static page to compare it all to.

    If you don’t mind saying, how much are you paying for this hosting? According to westhost’s page ALL clients are on their own VPS, even @ $4/mo which is kinda strange. If true, that means you can customize mysql yourself and install eaccelerator.

    top w and uptime are all done from a “shell” via SSH. You need to email them and ask them how you access your shell. If you are indeed on a VPS you should have access to one. Many shared hosting hosts block shell access because of security issues.

    #51581
    fel64
    Member

    Cool. :) Can you post the entirety of the code you’re using now, in case someone else will be looking through the forums for a full solution?

    #59544
    _ck_
    Participant

    Er, wait a minute. This new view registation method takes away massive potential from views.

    For example you can’t manipulate the data before and/or after the BB_QUERY.

    Here’s how I find “most viewed” and “least viewed” topics and create new views for them. How the heck is this even remotely possible with the new method? The new method also takes away all natural mysql query methods, making things much more complicated and easier to make mistakes on query configuration.

    function most_views( $view ) {
    global $bbdb, $topics, $view_count;
    if ($view=='most-views') {$sort="DESC";}
    if ($view=='least-views') {$sort="ASC";}
    if ($view=='least-views' || $view=='most-views') {
    $limit = bb_get_option('page_topics');
    $where = apply_filters('get_latest_topics_where','');
    $most_views = $bbdb->get_results("SELECT topic_id FROM $bbdb->topicmeta WHERE meta_key='views' ORDER BY cast(meta_value as UNSIGNED) $sort LIMIT $limit");
    foreach (array_keys($most_views) as $i) {$trans[$most_views[$i]->topic_id] =& $most_views[$i];} $ids = join(',', array_keys($trans));
    $topics ="SELECT * FROM $bbdb->topics WHERE topic_status=0 AND topic_id IN ($ids) $where ORDER BY FIELD(topic_id, $ids)";
    $topics = $bbdb->get_results($topics);
    $view_count = count($topics);
    $topics = bb_append_meta( $topics, 'topic' );
    }}

    .

    Absolutely no way to do that purely though BB_QUERY, at least to my limited knowledge. You’d have to hook BB_QUERY and check for what it’s doing on every call and that’s nasty.

    #59526
    nexlamar
    Member

    Chris, that´s a good one – now I use the domain-restriction plugin. That should work for now ;)

    #59488
    _ck_
    Participant

    Show me the code how you are exposing the time/date fields to the moderators on a new post?

    #52662
    _ck_
    Participant

    Dumb question: What should I add to post.php?

    Nothing. My version of this plugin requires absolutely no template or core edits. It’s why I made it ;-)

    It’s optional to put the style in your style.css to prevent an extra stylesheet but that’s trivial and not necessary.

    Note that I’ve turned on the default options of “one signature per user per page” and “only moderators and above can have signatures”. You can edit this in the plugin (change “moderate” to “participate”)

    There are still many, many things not checked in this, like they could trick it to post 100 lines in a signature or use a HUGE image if you have “allow images” installed. This for now comes down to moderators doing their job.

    #59566
    _ck_
    Participant

    Since there’s no real way to cache bbpress as static pages like wordpress (and not that there ever really can be, defeats the purpose) if you plan to have anything bigger than a “micro-forum” it’s important your host has mysql caching and optionally but recommend, some kind of php opcode cache (ie. eaccelerator)

    Otherwise you’ll be getting emails from your host about your account creating all of the mysql load, etc.

    The problem is I think most hosts do not have the two features I mentioned enabled. At least most shared hosting that’s done on cpanel “out of the box” on defaults. They have to be a bit more tech-savvy. And then if they are that clever, sometimes they will “oversell” the box thinking it can do more work than average.

    Last but not least, on all shared hosting and VPS, you can have great performance for the moments you test it, but then a “bad neighbour” comes along and your performance will become quite bad for no reasons of your own, until the host does something about it, which can be days. Sometimes even the host can make poor decisions that will cripple your site, like backing it up during times of higher activity or allowing the statistics programs to run on dozens of clients at the exactly same time.

    I wish I could afford dedicated hosting myself! Solves most of these problems. But spending $100 per year instead of $100 a month is no contest.

    ps. 2.490 – 8 queries is not good at all if you are expecting high traffic – I have mysql cache and opcode cache and get always get under 0.300 for 10-30 queries no matter how many visitors. But I suspect I pay much more for my hosting. My guess is there’s definitely no mysql cache on there or you are paying very very little for that hosting.

    #59565
    chrishajer
    Participant

    I would say if it seems slow to you now, it is going to seem slow to your users. especially when you have more of them. There’s a lot more to a good host than just the speed it takes to execute a bunch of queries, although that can point to a problem. My point is, there can be other problems that will not show up using just these diagnostics.

    Do you have any information about the host, their connection to the Internet, the hardware they are using, the number of other websites on the shared machine? Do you have a link to your forum so others can see the speed you’re seeing? So you have shell access where you can run a command like top?

Viewing 25 results - 29,476 through 29,500 (of 32,491 total)
Skip to toolbar