Search Results for 'code'
-
AuthorSearch Results
-
May 4, 2007 at 8:51 pm #57412
In reply to: *seamless* wordpress integration
Vili
ParticipantThe way I have integrated the two over at http://akirakurosawa.info/ is by editing the bbPress template so that it calls the WordPress headers instead of the bbPress ones.
I presume that you have installed both WordPress and bbPress, and that you have integrated their user databases and installed the required plug-ins as outlined at https://bbpress.org/documentation/integration-with-wordpress/ .
So, if you now go through the template files for your bbPress installation, you will need to replace all instances of “<?php bb_get_header(); ?>” with the WordPress command “<?php get_header(); ?>”. The same thing goes for the footers, so you change all instances of “<?php bb_get_footer(); ?>” to “<?php get_footer(); ?>”.
However, in order to get that to work properly, I have also edited my WordPress template so that the (WordPress) header and footer files contain everything except for the actual content that is going to be shown on the page. In other words, all the “container” DIV-elements and such are opened in the header and closed in the footer. While this is perhaps not absolutely necessary, it makes your life easier.
Finally, I use a boolean check in the WordPress header to see whether I am serving a bbPress page, and modify the header information accordingly. While I currently set the boolean myself by including
<?php global $forumpage;
$forumpage = TRUE; ?>at the very beginning of each relevant bbPress template page (i.e. those pages that call the header files), fel64 has pointed out that one could simply use a variable that bbPress uses anyway, for example $bbdb.
I use these checks to modify the title:
<?php if ($forumpage == TRUE) {
bb_title();
echo " :.: AKN&I";
} else ...to add the forum feed:
<?php if ($forumpage == TRUE) bb_feed_head(); ?>as well as do some other things (disable Ultimate Tag Warrior’s meta tags for the page, etc.).
So, it takes a little bit of playing around with your templates, but in the end it is doable without any actual hackery.
May 4, 2007 at 7:27 pm #55849fel64
MemberThere are a few things you can do. This WP plugin will, using also the bbPress Post plugin, show replies from the appropriate thread in your forum under your newspost, plus links to the thread to reply to it. You can also transfer existing comments; you need to be careful to only do it once, but that can also be found in that thread. It hasn’t yet been successfully made so that you can reply to the forum from the wordpress part of the site, as far as I know, but I’m sure it’s possible and will be done.
So it’s perhaps 2/3rds of the way there.
May 4, 2007 at 5:05 pm #55848Griffology
MemberMatt, have you finished this. I’ve tried to do it myself but with no luck I always end up throwing a sql error.
May 4, 2007 at 4:36 pm #55364In reply to: Pretty Permalinks Not Working
serimu
MemberI checked it again, and it is partially working. Forum links are accessible, but topic and others are not. I again tried three combination
1) just adding multipleviews to htaccess = not working
2) adding this solution = not working
# BEGIN BBPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forum/
Options +MultiViews
</IfModule>
# END BBPress3. adding the code generated by rewrite-rules.php. = partially working
May 4, 2007 at 4:03 pm #55363In reply to: Pretty Permalinks Not Working
serimu
Member+1
I did also all the things(at least three or more times, and even I create a mirror template for bbpress to match with my wordpress template when I was tired of trying the same things to make permalinks to work),. So, for those people who uses Godaddy;
It is not working with Godaddy. (Correction: It works for me, read below)
But it only took a couple of hours to update my wordpress, install and integrate bbpress with wordpress (even, partially, templates). For now, I will not move to another hosting company for permalink option. But it is a bit annoying because rewrite rules are working on Godaddy. I have installed wordpress(10 or more different websites), and drupal(3 or more websites), and no problem with permalinks. When you create your htaccess file for the first time, you need to wait for a couple of hours (in avarage 2-3 hours). After that first initialization, every change in htaccess are applied instantly. Namely you just need to wait only for the first time.
I also tried a simple redirect to check my htaccess file in forum root directory. And it was working.
So as the creator team of bbpress is the same for wordpress. And as wordpress is ok with godaddy. The team may suggest an alternative way for rewrite rules. I dont know much about rewrite rules. And I believe the file (bb-admin/rewrite-rules. php) creates correct rules for the most of the servers.
SOLUTION:
I wrote all the above information and then I think to add my config.php file to here. So I find out something, that I dont use akismet, so I add
//to beginning of that line, namely://$bb->akismet_key = ''; // Example: '0123456789ab'and it is working now
May 4, 2007 at 8:41 am #57392In reply to: Trying to integrate bbpress with my wordpress
fel64
MemberThat’s because you’re using a left-hand margin on your sidebar and your main div to push them to the right.
<div id="main">
<div id="discussions">
<div id="secondary">That’s roughly your HTML structure.
Mainis the full width of the central white bar, so there’s no way you can getSecondarynext to it.Discussionsis a sub-part ofMain, and it’s pushed over to the right by a large margin on the left.Secondaryis not part ofMain, and pushed over to the far right because it has a humoungous 71% margin.Firstly you want to put
Secondaryinto yourMaindiv, otherwise there’s no way to do it. Then you need to put either one on the left; the way to do this would be to get rid of its giant margin. That should work.Otherwise, if you’re not doing it by the margin property, you could put
SecondaryintoMainagain, then giveSecondaryandDiscussionsafloat: left;and afloat: right;property (or the other way around). If there’s enough room, they should now be side by side – otherwise make them narrower.You can also get rid of the
wrapper‘sborderproperties, that’s what’s giving you the double-width line.That’s a nice theme you made, though.
May 3, 2007 at 8:14 pm #57390In reply to: Adding a link to forum in my wordpress site
chrishajer
ParticipantFrom the looks of your site, it worked.
May 3, 2007 at 4:36 pm #56563In reply to: limit forums included in latest discussions
fel64
MemberYup! Find this (or similar) codeblock in your theme’s
front-page.php.<tr<?php topic_class(); ?>>
<td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
<td class="num"><?php topic_posts(); ?></td>
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><small><?php topic_time(); ?></small></td>
</tr>Around it put
<?php if( $topic->forum_id != 666 ) { ?>
... that code block ...
<?php } ?>You will probably want to change
666to whatever forum id you actually want to exclude. You can put any conditional logic you like inside those if( … ) brackets, so for example to filter for two forums you would putif( $topic->forum_id != 666 && $topic->forum_id != 999 ). Hope that helps.May 3, 2007 at 4:31 pm #57401fel64
MemberI think
require_once(orrequire,includeorinclude_oncefor that matter) need a path to the file rather than a URL. A path would be like the addresses you get when you’re browsing folders on your computer. I can’t say what your path would be, but mine is/home/username/public_html/wordpress/wp-config.php. Ask your hosting provider if you don’t know what to use.
It might be easier to recreate the theme anyway, if I remember rightly a fair few folks come here with problems when trying to stick bb into the WP theme like that.
May 3, 2007 at 12:25 pm #1821csl749
MemberHi folks,
I have WP and BB running off the same DB, integrating users etc as far as I can tell, and each working perfectly. But, following the instructions on the docs page on how to integrate WP functions so they can be called in BB, I get errors.
I put the
require_once('www.mywebsite.com/wp-blog-header.php');at the top of the BB config.php, in the hope that the WP functions would be discovered, but each time I try to add, say, a line to front-page.php like get_header or get_footer, to visually sandwich BB inside my WP header/footer, I get an error:Fatal error: Call to undefined function: get_header() in /home/csleary/public_html/forum/my-templates/lemodie/front-page.php on line 1
I’m very much a novice with all this, so I’m just following instructions at the moment hoping things will work. But as far as I can tell I’ve done everything correctly – please may someone offer some ideas as to what’s going wrong? While searching other integration threads, I came across one that said to make sure WP was loaded first, so BB could then load the functions, but I don’t know how to ensure this. BB is currently in siteroot/forum, and wordpress is in the root dir itself.
Any help would be fantastic, thanks.
May 3, 2007 at 4:09 am #57384In reply to: phpbb -> bbPress success…almost (SQL HELP!)
chrishajer
ParticipantCan you do it from a command line rather than a web interface to avoid the upload problem?
Can you upload the file and then do something like this on the command line:
mysql -u UserName -p DBName < TheFullTargetFilePath.SQL-p will prompt for the password on the command line
I imagine there’s probably a -h if you need to specify a different host too.
May 3, 2007 at 4:06 am #57388In reply to: Adding a link to forum in my wordpress site
chrishajer
ParticipantThere are a couple of tricks you could use (I have no idea how it’s done officially.)
In your site, all you would need to do is insert this into the template that contains the page navigation you have now (Home, About and Contact all appear to be pages):
<li class="page_item"><a href="<?php bloginfo('url'); ?>/forum/" title="Visit the forum">Forum</a></li>HTH
Chris
May 3, 2007 at 1:16 am #57381In reply to: phpbb -> bbPress success…almost (SQL HELP!)
migpilot
MemberHey fel64, I might get lynched if I drop off posts… quite a bit of great stuff there.
My import is up to around 30,000KiB, so that’s not the issue….
My SQL mojo man is AWOL, hence me coming here to look for some of the good SQL loving
May 3, 2007 at 12:56 am #57380In reply to: phpbb -> bbPress success…almost (SQL HELP!)
fel64
MemberI vaguely remember from setting up bb in localhost and trying to copy my server DB into my local MySQL that PHPMyAdmin wouldn’t take more than 16 Mb when importing. That might well be a setting that can be set somewhere, I don’t know; I can’t find it in its config file, in any case.
Edit: my localhost version of phpMyAdmin says “Max: 16,384KiB” by the import dialog.
To get around this if it is the problem, can you live without 1/3rd of the posts? Then you could delete them in the original database via some query and export the remaining 2/3rds. It might be better to hold out for someone with more database-mojo to come along and see if there’s a non-destructive way.
May 2, 2007 at 7:01 pm #57372In reply to: Code_trick made pluggable
Trent Adams
MemberMay 2, 2007 at 3:52 pm #56694In reply to: Plugin: Avatar Upload
LMD
ParticipantVersion 0.3 is now available for download from the plugin browser.
Version 0.3 is not compatible with previous versions, so you will have to go through your templates and make some changes to the template functions (check the Readme file).
New Features
* added an ‘Avatar’ tab to the profile menu
* added a ‘default avatar image’ option (if you don’t want to use fel64’s identicons — see previous posts in this thread).
* can access just the avatar’s URI for use in other plugins.
fel – how would you like me to link to the identicon’s plugin? Currently, I’m just linking to your post in this thread.
Oh and I have hacked together an Über-Avatar plugin which pulls together the various avatar plugins into one ‘api’. It iterates through some logic based on a specified order of preference (set by the admin), checking to see if the user has specified an avatar using each plugin.
For example:
Order to check: avatar-upload, bb-avatar. bb-myavatars, identicon
Has user uploaded an avatar?
— Yes: Invoke the ‘avatar-upload’ plugin template function and break.
— No… continue
Has the user specified an external URL?
— Yes, invoke ‘bb-myavatar’ template function and break.
— No… continue
Has the user got a Gravatar?
— Yes, invoke ‘bb-myavatars’ template functions and break.
— No… continue
Has the user got an identicon?
— Yes, invoke the same code as ‘avatar-upload’ and break.
— No. create an identicon and then invoke the ‘avatar-upload’ code.
It’s not perfect yet though, so no release.
May 2, 2007 at 2:13 pm #57352In reply to: Plugin: Move It
gh3
Membermeanwhile I wait for the svn account, i can say you that now we are on 0.11 version, i have just finished to add the upgrade topic info for both destination and original thread.
sooner the download link… i hope
May 2, 2007 at 12:27 pm #57341In reply to: MathML and BBpress working together
dprice
MemberAh – so ridiculously easy! I’m liking BBpress more and more
. I just requested code_trick to become pluggable too – hopefully that’ll happen, and soon, so I can just use a plugin and not hack at core files.
May 2, 2007 at 12:20 pm #1815Topic: Code_trick made pluggable
in forum Requests & Feedbackdprice
MemberRequest: functions-fomatting.php code-trick() to be made pluggable.
Reason: So parsers such as ASCIIMath can do their replacements on things in backticks. Then I can make a plugin for MathML support
May 1, 2007 at 10:40 pm #57350In reply to: adding wordpress admin link
fel64
MemberDoes that work? It should have been:
<?php if( bb_current_user_can('administrate) ) {
$wp_admin = 'wordpress/wp-admin/';
echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>Sorry!
May 1, 2007 at 9:10 pm #57349In reply to: adding wordpress admin link
midnightsun
Memberhey,
it doesn’t seem to be working! i’ve edited it a little
<?php if( bb_current_user_can('administrate') {
$wpadmin = 'wordpress/wp-admin/';
echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>)May 1, 2007 at 8:53 pm #57348In reply to: adding wordpress admin link
fel64
MemberSure. Paste this in your HTML code somewhere:
<?php if( bb_current_user_can('administrate) {
$wp_admin = 'http://link.to.your/wordpress/wp-admin/';
echo '<a href="'.$wpadmin.'">Wordpress Admin</a>'; } ?>May 1, 2007 at 8:28 pm #57329In reply to: Site using bbpress: purposegames.com
wmarcy
MemberAny chance you could show us the code for your admin stuff?
May 1, 2007 at 7:16 pm #56258In reply to: importing bb_users into wp_users
wittmania
MemberThe reason that happened is that the user roles are stored in a separate table. If it is an integrated site, they are in wp_usermeta (or bb_usermeta if not integrated) where the meta_key is
bb_capabilitesand the meta_value is the capabilities assigned to them. I have no idea what the syntax for these capabilities is. However, if you wanted you could go into the database and search for the user ID that you are changing, and just change it there. Otherwise, reassigning the role might be just as easy, though it will still leave the record in the usermeta DB for that ID number, which might cause some problems. Unfortunately, there just isn’t an easy way to do this.
May 1, 2007 at 5:33 pm #57337In reply to: Include code in posts
wittmania
MemberTrent uses
if (bb_current_user_can('administrate'))in his YouTube plugin. Couldn’t you mod the allow_images plugin to also allow<script>tags, but only if the user is an administrator? That would still allow the scripts to do their thing, but only in posts authored by an administrator.Unfortunately, if you’re looking for a way to place ads in posts by any ol’ user, there’s not a safe way to do that b/c they could put ANY script in and have it execute.
Best bet? bb-Ads. Situations just like this are what I wrote it for. You can see it in action at blog.wittmania.com/bbpress
-
AuthorSearch Results