Search Results for 'code'
-
AuthorSearch Results
-
July 31, 2007 at 12:20 am #52665
In reply to: Plugin: [REL] Signature
citizenkeith
ParticipantThanks fel!
In the meantime, I’ll just edit HTML special characters in my user’s signatures.
July 30, 2007 at 11:38 pm #58871In reply to: Can’t put code between backticks after upgrade
outchy
Memberyeah this is happening for me too. any luck?
July 30, 2007 at 10:48 pm #52664In reply to: Plugin: [REL] Signature
fel64
MemberBy 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.
July 30, 2007 at 10:29 pm #52663In reply to: Plugin: [REL] Signature
citizenkeith
ParticipantThanks guys, I figured it out.
Dumb Question #2: How does one use quotes or apostrophes in their signatures? Forward slashes are inserted before each instance.
July 30, 2007 at 10:22 pm #59590In reply to: Limit long words
fel64
MemberYou 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.
July 30, 2007 at 9:27 pm #52950In reply to: usually forums would have…
chrishajer
ParticipantI think the real question here is “what the heck is a winesap”?
July 30, 2007 at 9:04 pm #59589In reply to: Limit long words
bobbyh
MemberIt 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; }
July 30, 2007 at 9:00 pm #59576In reply to: How to evaluate server speed?
chrishajer
ParticipantIf 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.July 30, 2007 at 7:49 pm #59586In reply to: Limit long words
bobbyh
MemberYeah, the easy fix for this is adding:
.post {overflow: hidden; }
July 30, 2007 at 7:47 pm #57812In reply to: Theme: Misty for bbPress
MaryJane
MemberI 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.
July 30, 2007 at 5:36 pm #59572In reply to: How to evaluate server speed?
_ck_
ParticipantWell 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.
July 30, 2007 at 5:20 pm #51582In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberyes, 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; ?>July 30, 2007 at 4:45 pm #59547In reply to: “My Threads” – User Specific Views
howtogeek
MemberJust 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.
July 30, 2007 at 4:32 pm #52949In reply to: usually forums would have…
riddle
MemberI 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.
July 30, 2007 at 3:44 pm #59569In reply to: How to evaluate server speed?
_ck_
ParticipantPage 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.
July 30, 2007 at 1:23 pm #51581In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberCool.
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?
July 30, 2007 at 8:03 am #59544In reply to: “My Threads” – User Specific Views
_ck_
ParticipantEr, 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.
July 30, 2007 at 7:58 am #59526In reply to: Protection against human spamming and double e-mail
nexlamar
MemberChris, that´s a good one – now I use the domain-restriction plugin. That should work for now
July 30, 2007 at 7:50 am #59488_ck_
ParticipantShow me the code how you are exposing the time/date fields to the moderators on a new post?
July 30, 2007 at 6:55 am #52662In reply to: Plugin: [REL] Signature
_ck_
ParticipantDumb 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.
July 30, 2007 at 6:34 am #59566In reply to: How to evaluate server speed?
_ck_
ParticipantSince 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.
July 30, 2007 at 5:25 am #59565In reply to: How to evaluate server speed?
chrishajer
ParticipantI 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
?July 30, 2007 at 1:41 am #51580In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberexcellent! 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!
July 30, 2007 at 1:37 am #51579In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberThat’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 liketopic_title()
andlink_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 betopic_title( $latestpost->topic_id );
July 30, 2007 at 1:10 am #51578In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberwait, 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
-
AuthorSearch Results