Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,426 through 29,450 (of 32,438 total)
  • Author
    Search Results
  • #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?

    #51580
    outchy
    Member

    excellent! i got it to work with this just before i checked back for your reply:

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

    i think i understand it better now, thanks again! :D

    #51579
    fel64
    Member

    That’s great! Passing parameters is just giving the function some data to work with.

    $latestpost->topic_id is the topic ID. There are probably some functions like topic_title() and link_to_topic() or similar that you can use to get the title and link. They too will need the topic ID passed as a parameter, so if those are the actual functions it could be topic_title( $latestpost->topic_id ); :)

    #51578
    outchy
    Member

    wait, i got this to work to display the name:

    <?php echo get_user_name($latestpost->poster_id); ?>

    and this to make it into a link to the person’s profile:

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

    now all i need is to display the topic title and make it a link … i need help with this one please :)

Viewing 25 results - 29,426 through 29,450 (of 32,438 total)
Skip to toolbar