Search Results for 'code'
-
AuthorSearch Results
-
September 5, 2007 at 11:08 am #56915
In reply to: Fix or remove bozo function before it kills bbPress
airdrawndagger
MemberYou can also alternatively get rid of it all together just by taking this line out of bb-settings.php:
require( BBPATH . BBINC . 'bozo.php');
&&
require( BBPATH . BBINC . 'akismet.php');
YMMV.Why would I need to take out the akismet.php as well?
September 5, 2007 at 4:21 am #60507In reply to: tr td .num font size?
chrishajer
ParticipantIn your theme’s style.css (or the default theme style.css) you want to find this at around line 255:
.num, #forumlist small {
font: 11px Verdana,Arial,Helvetica,sans-serif;
text-align: center;
}That controls the styling of <td class=”num”>.
I also recommend you use the Firefox web browser with the Web Developer add-on by Chris Pederick for finding things like this.
September 5, 2007 at 12:09 am #60493In reply to: Unread Topics
henrybb
MemberCool!
Yeah, I haven’t really done much in PHP. And I basically hacked this plugin up in two evening sessions.
Thanks for the suggestions, I’ll have a look at the code again.
)
Actually the number of posts stuff was an idea that didn’t pan out.
The two functions for new/unread were actually that there initially was just the unread stuff, then I added the “new” check so it would bold new topics. I need a different one for the topic_link filter, cause I don’t want to change the link for brand new topics.
September 4, 2007 at 9:37 pm #60492In reply to: Unread Topics
fel64
MemberErr, no.
I read your description here. I thought about that approach before but I like the time-based implementation, especially as my hosting is a bit creaky (and edit: having come to the finish of this post, I realise that it’s actually not that bad at all! Maybe it is a good idea, especially as it’s a lot more convenient). It’s good that you’ve done it though, and cool that you’re sharing it (in the face of adversity
). I hope you don’t mind; here’s some suggested changes that could speed things up a lot.
For installing the table, you may want to use
bb_dbDelta()
(should work exactly as wp’s implementation: https://codex.wordpress.org/Creating_Tables_with_Plugins ).There are also a lot of queries made that you could probably avoid. For example, in the topic listing the current topic will be in the global $topic, and you can get its last_post_id by this:
$last_post_in_topic = $topic->topic_last_post;
You can do the same for the number of posts.
Every column in the table will be available as a member variable (don’t know how familiar you are with PHP? Member variables are just like above, $member->!!!member_variable!!!) – that’s true for users, posts, topics and forums alike. (Meta entries are too, if there’s an entry topic_colour in the topicmeta table you can call it by $topic->topic_colour.)
Right now you’re making at least three additional queries per topic:
if ( utplugin_is_topic_unread($topic, $user) || utplugin_is_topic_new($topic, $user) )
utplugin_is_topic_unread() makes three queries. If it’s not unread, it’ll check if it’s new, too, which is another two. For the default 30 topics, that’s 90 – 150 additional database queries per single view of a page. Since db queries are usually the bottlenecks in website speed that could be a problem. (_ck_ would probably blow an artery.)
By using the already-queried stuff from
global $topic
you can cut that down to one or two topics per query. Also, in utplugin_is_topic_new() you’re using exactly the same value again, but making a new query for it, if I see that right. You could either move the check to utplugin_is_topic_unread() (which would return true for unread and for new) or make that a global itself.That would make it at most one query per topic.
Finally, IIRC data for all topics on the page is being called in a single query. If you can find the right filter or hook, you may find that you can get all the relevant topic_ids at once, at the start, then do a _single_ query on your table that gets data for all of them, make that a static (so it’s preserved every time the function is called) and use that data every time. Then the overhead generated by your plugin wouldn’t even be so bad.
September 4, 2007 at 7:32 pm #60491In reply to: Unread Topics
henrybb
MemberWell I’m allowed atleast one misconception aren’t I?
WordPress has the same weird approval stage. But what I don’t get is that I wasn’t given a chance to upload either the plugin or the readme, I just input the name of the plugin and the whole process hinges on that one name.
Started wondering if I was at all comfortable with “Unread Topics” as a name
Anyway, did you look at the plugin fel?
September 4, 2007 at 6:19 pm #60095In reply to: top 100 bbPress sites
_ck_
ParticipantDon’t get too comfortable on your position in the list
As I get more time to code it and add more data, the positions keep slipping. Now almost 1500 sites with ~1100 or so listed.
September 3, 2007 at 9:11 pm #52914In reply to: MediaWiki, bbPress, and WordPress integration..
fel64
MemberI don’t understand. PHP5 runs PHP4 code just fine; if it runs on 4, it will run on 5. (Other way around may be a problem, but that doesn’t seem to be it?) The plugin might not use features of 5, but it will run under 5.
September 3, 2007 at 8:48 pm #52913In reply to: MediaWiki, bbPress, and WordPress integration..
Heliotropen
MemberWhat a cool guide, – huge shoulder claps from me to you!
There is one HUGE problem though;
1.this plugin is no longer avaible?
https://codex.wordpress.org/User:RobLa/bbPress_Auth_for_MediaWiki
2. this IS, BUT, it is wrtiten that it dosn’t suport php5 (therefor any useable media wiki installations right now.)
http://hery.blaogy.org/2007/02/21/mediawiki-wordpress-integration/
Is there any plugin or way out there, to make the step nr. 4 in the guide possible. – The mix is not soo cool, with wordpress & bbpress intigration only.
In advance thnx.
/Helio
September 3, 2007 at 7:37 pm #60474In reply to: I can’t install bbPress.
chrishajer
ParticipantOK – everything appears to be in the correct location now. I think there is just a simple problem with the config.php database details now. Can you verify that these 4 are absolutely accurate in your config.php?
define('BBDB_NAME', 'xxxxxxxx');
define('BBDB_USER', 'xxxxxxxxx');
define('BBDB_PASSWORD', 'xxxxxxxx');
define('BBDB_HOST', 'xxxxxxxx');The host might not be localhost. Mine is not. And you don’t have a syntax error in the file (like a missing or extra quote) but something like one of those values is inaccurate. Posting it here in edited form won’t help, you have to verify that the database name, user, password and host are all accurate. You’re the only one who can do that. Once you have that, we need to get back to the original problem.
September 3, 2007 at 7:23 pm #60191In reply to: Images, a pain in my side…
neyoung
MemberI found this to trace functions. But I don’t have access to the php.ini file so there’s no way I can install it
September 3, 2007 at 7:07 pm #60190In reply to: Images, a pain in my side…
neyoung
MemberI’m using wordpress mu so I’m sure that there is a big discrepancy
Is there a way that I can trace which functions are called when a post is made? That why I can follow the execution with and without the wordpress functions loaded and find out what the difference is?
September 3, 2007 at 6:45 pm #60470In reply to: I can’t install bbPress.
chrishajer
Participantregarding your setup
1. did you install phpMyAdmin yourself, or is it part of a control panel?
2. did you edit any config files by hand?
3. what do your installation directories look like (i.e. where did you install phpMyAdmin in relation to the other directories you have for your WP and bbPress installations?)
is it something like
/home/llab/public_html/wordpress/
/home/llab/public_html/wordpress/forums/bbpress/
(why the extra directory here ^?)/home/llab/public_html/phpMyAdmin/
Is your config file for bbpress in the forums directory or the bbpress directory? (IMPORTANT)
I think the forums directory is extra, and maybe that’s causing problems?
September 3, 2007 at 2:08 pm #60456In reply to: Windows platform to linux
benbeltran
MemberTry Using XAMPP, it works for windows
September 3, 2007 at 12:37 pm #60188In reply to: Images, a pain in my side…
neyoung
Memberok. I’ve figured out whats causing the problem. It comes down to the Default Role Plugin. There is nothing wrong with the plugin itself other than the fact that it relies on wordpress functions. Thus you need to load wp along with bbpress. To do so I have the following added to the top of my config.php file.
require_once('../wp-blog-header.php');
define('WP_BB', true);With the two lines in the config.php file the allow images plugin does no work. I even tried disabling the Default Roles plugin and leaving the 2 lines in config.php to make sure the plugin wasn’t the culprit. If I remove the two lines the Allow Images plugin works as expected.
I don’t know much, but I could take a stab at whats happening. Is it possible that when a reply/topic is made, bbpress is calling wordpress functions instead of bbpress functions?
September 3, 2007 at 8:11 am #60411In reply to: Inline Images?
kdma
MemberWould you mind giving me a quick instruction on how to do that? I mean, are we talking a simple search and replace get_option() to bb_get_option() in particular files? or even one file? If that’s the case, easy enough, so be it. but..?
In all honesty, I really just want to be able to have people upload a zip file and have it extract and post thumbnails to a thread. Anyone should/would be able to do this. Sadly with NGG, you can only have the admin do it.
Are there any other mods out there that allow this?
September 3, 2007 at 2:34 am #60445chrishajer
ParticipantAnd, the previous one, 20 seconds
September 2, 2007 at 6:49 pm #59909benbeltran
MemberSeptember 2, 2007 at 6:47 pm #59882In reply to: theme: hybrid kakumei+bbpress.org template
benbeltran
MemberPractice makes perfect and you have a great headstart. I’ll talk with my associate about shell access and everything and see if we can reach a nice agreement
September 2, 2007 at 6:01 pm #60092In reply to: top 100 bbPress sites
_ck_
ParticipantI don’t want any kind of “phone home” plugin as that can be accidentally considered spyware as that’s not my style at all. I’d rather do it passively. I’ll eventually make a way for people to submit new sites or manually update stats if they need to.
I’ve taken the fake numbers game into account.
Anyone with a sharp increase in members or posts after each month will be examined carefully
I’ll remove anyone permanently that I catch “faking”. It’s kinda silly anyway, it’s not like you get anything for being higher.
September 2, 2007 at 4:33 pm #60090In reply to: top 100 bbPress sites
fel64
Memberposts and users over time
is the only thing you don’t have – and all I meant was since launch, anyway. Everything else you do have.September 2, 2007 at 2:42 pm #60435In reply to: login-form.php template doesn’t work
wpitn2shape
MemberIt works now to style login.php in my template folder, NOT login-form.php, but I swear it didn’t work before. I had put the same code in both of those template files. Weird.
September 2, 2007 at 2:20 pm #60434In reply to: login-form.php template doesn’t work
wpitn2shape
MemberIf when I put my WP log in form into bb-login.php and when that redirects to wp-login.php but shows a 404 (when the file is there), should I go to WordPress MU forums to ask for help?
>>>>
OK It also happens when I put bb-login.php into the code instead of wp-login.php, but I’m sure it’s still a WP/MU thing.
Putting my WP login box on the sidebar of the main page of the forum works however, so what I really need is to be able to change the log in message at the bottom of those pages.
September 2, 2007 at 5:02 am #51642In reply to: Bozo – what are the triggers?
henrybb
MemberThis is still happening. If a user is marked a bozo once, there’s some nook in the system that never allows him to post again without yelling “spam” unless you remove the meta record from bb_usermeta. Really annoying.
Also anyone know why bozo status isn’t just a checkbox in the Kakumei theme??
EDIT: Removing the meta tag didn’t work either
September 2, 2007 at 4:44 am #59908Trent Adams
MemberFrom our fearless leader!
/*
Plugin Name: Recent Stickies
Author: Micheal Adams
Description: Adds a class to recent sticky posts
*/
function recent_sticky_class( $class, $topic_id ) {
$topic = get_topic( $topic_id );
if ( !$topic->topic_sticky )
return $class;
if ( get_topic_start_time( 'timestamp' ) < time() - 604800 )
return $class;
$class[] = 'recent-sticky';
return $class;
}
add_filter( 'topic_class', 'recent_sticky_class', 10, 2 );Trent
September 2, 2007 at 4:39 am #60085In reply to: top 100 bbPress sites
_ck_
Participant@Trent Oh that’s weird, how did I miss that one! Thanks!
@chrishajer right now it’s ranked based on activity, not prettiness but user voting for 1. style 2. content will come eventually
@fel64, I might release it under creative commons after I fix it up some more. There are some problems – excluded sites, repeated sites, etc. Plus I want to add more stats to them like tie them to alexa data, etc. I’m just low on time and have too many projects going on
I need to figure out an anonymous donate system too, all this is starting to chew into my regular work!
-
AuthorSearch Results