Search Results for 'code'
-
AuthorSearch Results
-
May 4, 2007 at 8:41 am #57392
In 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
May 1, 2007 at 5:23 pm #57336In reply to: Include code in posts
fel64
MemberYeah, and that’s where it’s annoying because you can’t easily check if a given user has permissions. Might be worth a trac ticket request.
Possibly easiest would be to attach a filter for the post being submitted, because then you can use the
bb_current_user_can()function.May 1, 2007 at 4:17 pm #57335In reply to: Include code in posts
Null
MemberWell this doesn’t adress ads only, the question is more that the admin have more rights (like javascript/html entries) then ‘normal’ users.
Can be done let me think…………….
– You’ll have to enter some new tags in the plugin (allowed tags)
– Then in the template files containing post fields, you could add the tags and make them visible for the admin only with something like: if user can edit;
Now you can use javascript and other tags that you’ve entered and only the admin can see these links/buttons, but every1 can use them though
…So some filter should be added in view.php? like euuhh…
If post is by admin, allow tags x,y,z else print as code...This way if a user tries to put in some javascript code it will be displayed as code and if the user is admin it will execute/display it.
In theory
May 1, 2007 at 3:53 pm #57334In reply to: Include code in posts
fel64
MemberIf you can’t edit the template and have something against the excellent bb-Ads plugin: I can’t help you, because AFAIK there’s no straightforward API function to check what a non-current user can do.
May 1, 2007 at 3:47 pm #57340In reply to: MathML and BBpress working together
fel64
MemberThanks!
You can include ASCIIMathML.js in the header via plugin by this sort of code:
`function incMathJs() {
$url = bb_path_to_url( dirname(__FILE__) . ‘/ASCIIMathML.js’)
echo ‘<script type=”text/javascript” src=”‘ . $url . ‘”>’;
}
add_action( ‘bb_head’, ‘incMathJs’ );
Not sure when or how the JS kicks in, but perhaps that’s not necessary? Anyway, you could head over to trac and request that code_trick be made pluggable (so a plugin could overwrite it).
May 1, 2007 at 2:15 pm #57333In reply to: Include code in posts
dprice
MemberThere is a plugin to allow the img tag, but you’d need to edit it and add a statement in saying “if admin then allowed_tags = …, else allowed_tags = …”. I’m not sure how easy that would be – anyone else have any clues?
I’d suggest editing the template in bb-templates and adding it in manually, if you really, really want a banner ad.
-
AuthorSearch Results