Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,476 through 29,500 (of 32,481 total)
  • Author
    Search Results
  • #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 :)

    #51577
    outchy
    Member

    so to get the last poster’s username to display, do you do something like this?

    <?php echo get_user_name($user_id); ?>

    i guess i don’t understand the whole passing parameters thing :/

    #59563
    fel64
    Member

    Use the port of a pretty cool wp server diagnostics plugin. https://bbpress.org/forums/topic/front-page-takes-50-mysql-queries?replies=15#post-9140

    Just add define( 'SAVEQUERIES', true ); to your config.php and activate this. Then go to View > Page Source and scroll to the bottom to see the diagnostics. (You can ignore all the stuff about queries. Just check out query time, page time, page render time. This tells you about the server bottlenecks.)

    I just checked the numbers on my server, and I had 3.399 once and about twenty minutes later I had 0.436. This sort of thing can vary a lot, especially on shared hosting.

    #51575
    fel64
    Member

    I don’t know which ones you had problems with but it’s worth noting that some automatically echo and some don’t.

    <?php user_profile_link(); ?>

    =

    <?php echo get_user_profile_link(); ?>

    If they’re get_anything then you have to echo them yourself, if they don’t have get_* then it’ll echo on its own.

    [Edit] Also remember most functions don’t need a $user_id passed as parameter but won’t work in this case unless you do pass it.

    #59450
    _ck_
    Participant

    Oh if you are trying to do it from an integrated WordPress you’ll need to do this:

    <?
    if function_exists("get_currentuserinfo") {global $user_ID;}
    else { $user_ID=bb_get_current_user_info( 'id' )}
    if ($user_ID) { echo '<a href="/forums/profile.php?id='.$user_ID.'&tab=favorites">favorites</a>';} ?>

    untested – change /forums/ to whatever your bbpress path is.

    nexlamar
    Member

    Hi!

    For my bbpress I need a check against human spam attacks.

    For this I just need a random generated question in my language (the one that the spammers cannot speak ;) ) and a check if the postet answert is correct. I tried to implement this into register.php, but my checks are ignored by bbpress. Is there anybody who can give me a hint, who maybe works on the same problem?

    I also figured out that I can register twice with the same e-mail adress. How can I check if the adress already exists?

    Thanks for your help,

    Markus

    #51574
    outchy
    Member

    yes, that worked, thank you.

    i’m going through the template-functions.php trying to find how to display the last poster’s username and his/her profile link, as well as the link to the topic itself but the only ones i can get to work are these:

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

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

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

    any suggestions? :)

    #59539
    Sam Bauers
    Participant

    > Any idea what I could be doing wrong here?

    Are you using the latest trunk or the standard 0.8.2.1 release?

    Latest trunk won’t work with the above code.

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