Search Results for 'code'
-
AuthorSearch Results
-
April 25, 2007 at 8:24 pm #57221
In reply to: Strange browser problem
chrishajer
ParticipantI have no idea honestly. I am using WP with permalinks and bbP without permalinks and it works fine all over the place (FF and IE, Linux and Windows.)
I did notice with weirdness in the forum source:
<script type="text/javascript" src="'. bb_get_option('uri') .'my-plugins/bb-emoticons.php?bb_grins_output=javascript"></script>
Looks like the bb_get_option wasn’t wrapped in php tags? Maybe there are more things like that?
April 25, 2007 at 7:51 pm #1794Topic: Hack: bb replies as wp comments; using bb API?
in forum PluginsApril 25, 2007 at 6:28 pm #55707In reply to: simple way to add TinyMCE to BBpress
kernow
Memberfel64 wrote: How did you make it work?
Its easy to install really. You have the main tinymce folder which I opened and uploaded the contents to the ‘my-plugins’ folder. This is the mistake I made.
- Just upload the jscript folder within the tinymce folder to my-plugins
- Edit header.php in your bbpress template, adding the reference to the javascript
This is part of the code which I copied, which you put before the </head> closing tag in header.php.
<script language=”javascript” type=”text/javascript” src=”http://example.com/bbpress/my-plugins/jscripts/tiny_mce/tiny_mce.js”></script>
Change to:
<script language=”javascript” type=”text/javascript” src=”my-plugins/jscripts/tiny_mce/tiny_mce.js”></script>
The FULL code you put in header php is the top of the page, but this bit is important.
April 25, 2007 at 4:10 pm #57215In reply to: Anyone have Prev/Next Thread / Forum plugin?
fel64
MemberAhh, that’ll teach me to remember the difference between get_bbpress_thing() and bbpress_thing(). >_< Sorry.
Replace the code in there now with this.
Set the last parameter to true if you want it to return an array of information. To use this you would use code like this:
<?php $mytopicnavarray = feltopicnav( '', '', ' ', true, true );
echo '<a href="' . $mytopicnavarray['next']['link'] . '">Click here to go to the next topic!</a>'; ?>Use
<?php felforumnav(); ?>
to get the forum navigation in a similar way to the topic navigation. It’s just a simple wrapper for what feltopicnav does, but it’s a bit easier to see what it’s supposed to do. Check the code for possible parameters.I won’t submit this as a proper plugin because the code is awkward. Maybe sometime I’ll recode it or someone else will.
<?php
/*
Plugin Name: Topic Navs;
Plugin URI:
Description: Put <?php feltopicnav(); ?> in a topic template to show links to the previous and next topics, and put in <?php felforumnav(); ?> to get basic next/previous forum navigation. More parameters such as $infoonly available.
Author: fel64
Version: 0.7
Author URI: http://www.loinhead.net/
*/
function feltopicnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $lastpost = true, $infoonly = false, $forumnav = false; )
{
global $topic_id;
$nexttopic = $topic_id + 1;
$prevtopic = $topic_id - 1;
global $forum_id;
$nextforum = $forum_id + 1;
$prevforum = $forum_id - 1;
if( !$nexttext )
if( !$forumnav ) {
$nexttext = get_topic_title( $nexttopic );
} else {
$nexttext = get_forum_name( $nextforum );
}
if( !$prevtext )
if( !$forumnav ) {
$prevtext = get_topic_title( $prevtopic );
} else {
$prevtext = get_forum_name( $prevforum );
}
$prevtext = get_topic_title( $prevtopic );
if( $lastpost ) {
$nextlink = get_topic_last_post_link( $nexttopic );
$prevlink = get_topic_last_post_link( $prevtopic );
} else {
if( !$forumnav ) {
$nextlink = get_topic_link( $nexttopic );
$prevlink = get_topic_link( $prevtopic );
} else {
$nextlink = get_forum_link( $nextforum );
$prevlink = get_forum_link( $prevforum );
}
}
if( $infoonly ) {
$topicnavinfo['next']['title'] = $nexttext;
$topicnavinfo['next']['link'] = $nextlink;
$topicnavinfo['prev']['title'] = $prevtext;
$topicnavinfo['prev']['link'] = $prevlink;
return $topicnavinfo;
} else {
echo '<a href="' . $prevlink . '"> « ' . $prevtext . '</a>' . $betweentext . '<a href="' . $nextlink . '">' . $nexttext . ' » </a>';
}
}
function felforumnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $infoonly = false )
{
$fni = feltopicnav( $nexttext, $prevtext, $betweentext, false, true, true );
if( $infoonly ) {
return $fni;
} else
echo '<a href="' . $fni['prev']['link'] . '"> « ' . $fni['prev']['title'] . '</a>' . $betweentext . '<a href="' . $fni['next']['link'] . '"> « ' . $fni['next']['title'] . '</a>';
}
}
?>April 25, 2007 at 4:00 pm #57186In reply to: Show exact date of post? (not freshness)
fel64
MemberPaste in
<?php global $post;
$lalaposttime = date( 'D M Y', strtotime( $post->post_id ) );
echo $lalaposttime; ?>anywhere you like outside other
<?php ... ?>
tags. So you could put it next to the code snippet you quoted. If you use Notepad 2 or something it makes it a lot easier by colour-coding these things.The fact that it’s spread out over several lines doesn’t make a difference when it’s inside the
<?php ... ?>
tags.April 25, 2007 at 12:27 pm #57213In reply to: Anyone have Prev/Next Thread / Forum plugin?
Nola1974
Participantyou rule.
how about prev / next forums?
I plan on doing something kinda neat with this. you’re definitely getting thanks.
April 25, 2007 at 8:38 am #57184In reply to: Show exact date of post? (not freshness)
fel64
MemberI suspect that this will work. Replace
get_post_time()
or whatever it is withglobal $post;
echo $post->post_time;(Remember to have the
<?php
…?>
tags around it!) If you want different formatting on that, I think that$post->post_time
is a bit too much detail so you could instead haveglobal $post;
$lalaposttime = date( 'D M Y', strtotime( $post->post_id ) );
echo $lalaposttime;You can change the way the date will appear by changing the first parameter (currently it’s ‘D M Y’) of the
date()
function. A list of how you can format dates is here.April 24, 2007 at 6:29 pm #56406In reply to: Freshness Linked
fel64
MemberThe topic closed thing comes from the pagecount being too high. I think
get_topic_last_post_link()
must be screwing up – did the latest reply thing stop working immediately after recount? Not sure what the solution is, sorry. Perhaps get the latest version, see if the problem persists?I just recounted on my forum (running 1.0-alpha), but it seems to still work.
April 24, 2007 at 6:18 pm #57212In reply to: Anyone have Prev/Next Thread / Forum plugin?
fel64
MemberThere is now!
Save this in a file, call it
sumting.php
, and drop it into yourmy-plugins
folder. Then put<?php feltopicnav(); ?>
somewhere in a topic template. Not tested, so please tell me if it works.<?php
/*
Plugin Name: Topic Navs;
Plugin URI:
Description: Put <?php feltopicnav(); ?> in a topic template to show links to the previous and next topics. Optional parameters are $nexttext, $prevtext, $betweentext and $lastpost.
Author: fel64
Version: 0.7
Author URI: http://www.loinhead.net/
*/
function feltopicnav( $nexttext = '', $prevtext = '', $betweentext = ' ', $lastpost = true )
{
global $topic_id;
$nexttopic = $topic_id + 1;
$prevtopic = $topic_id - 1;
if( !$nexttext )
$nexttext = topic_title( $nexttopic );
if( !$prevtext )
$prevtext = topic_title( $prevtopic );
if( $lastpost ) {
$nextlink = topic_last_post_link( $nexttopic );
$prevlink = topic_last_post_link( $prevtopic );
} else {
$nextlink = topic_link( $nexttopic );
$prevlink = topic_link( $prevtopic );
}
echo '<a href="' . $prevlink . '">' . $prevtext . '</a>' . $betweentext . '<a href="' . $nextlink . '">' . $nexttext . '</a>';
}
?>April 24, 2007 at 2:02 pm #54417In reply to: about WP-BB user role prob
Nicki Faulk
Member“What I ended up doing was removing the forum registration”
That’s exactly what I did for mine. Instead, I just pointed to the WP register link and that works out beautifully for me.
April 24, 2007 at 2:35 am #57143In reply to: Registration Email Not Being Sent – new issue
chrishajer
ParticipantRyan,
That is with the command line version? The -r just tells it to run the following code without the <?php ?> tags. Maybe they don’t have a command line version installed for your use.
Did you try the web php version?
–Chris
April 24, 2007 at 1:45 am #52908In reply to: MediaWiki, bbPress, and WordPress integration..
citizenkeith
Participantbump
April 23, 2007 at 10:53 pm #57142In reply to: Registration Email Not Being Sent – new issue
stuboo
MemberThanks for the message. I got this error
Error in Argument 1, char 2: option not found r
Thanks,
Ryan
April 23, 2007 at 5:12 pm #57136In reply to: My Forums: Temporada De Patos
benbeltran
Memberyeah
it should … li uses display:list-item and uses different properties … like line-height instead of height and it behaves differently in some contexts.
In some cases using the default display mode it would overlap with other items, but with display:block; it stretches properly
fel64
MemberIn MCE it always assumes the next paragraph to be b-quoted too, unless you specify otherwise. I think it’s default behaviour.
You could probably modify the Quote plugin so that instead of returning
<blockquote> quoted stuff </blockquote>
it attached a newline character or two. Something like<blockquote> quoted stuff </blockquote>nn
might be enough as a modification, I’m not sure. MCE should interpret the two new lines as a new paragraph, hopefully without blockquotage.April 23, 2007 at 3:33 pm #57081AphelionZ
Participantfel64, thanks
I will try the post plugin
AphelionZ
ParticipantIt’s a hard problem to explain – if you go into a thread and quote somebody, it shows up in the MCE as
<blockquote> quote </blockquote>
In the editor, it kind of locks you into blockquote mode – first, the quote is indented, which isnt so much of a problem as it is just a display discrepancy as the quotes aren’t indented in posts..
however, when you hit return, the next paragraph shows up as a new blockquote and doesnt default back to plain text inside the editor, and you have to hit tinyMCE’s ‘outdent’ button.
More or less a pain, but one that might get people to stop posting
April 23, 2007 at 3:30 pm #55703In reply to: simple way to add TinyMCE to BBpress
AphelionZ
ParticipantThanks. Yeah I hear where you’re coming from, TinyMCE slows my site down a bit and im having trouble with blockquotes, but you can slim it down and make it tiny, so i’ll stick with it for now… ive already started copying over all my emotions into it
April 23, 2007 at 2:02 pm #55559In reply to: Hooks & Filters Docu
fel64
MemberApril 23, 2007 at 8:47 am #55702In reply to: simple way to add TinyMCE to BBpress
Null
MemberLike fckEditor…
But to be honest, these scripts are too big for bbPress. bbPress only supports
a blockquote br code em strong ul ol li
and not colors, images, tables, font types etc.I am thinking of writing a wysiwyg editor that only supports these standard markups and when an extention/plugin is installed (smilies, images) it will support these too. And it will be skinable ofcourse to match the theme installed.
But I am a busy man, so this will not happen anytime soon
April 23, 2007 at 8:39 am #56377In reply to: Plugin: bbMenu 1.1
Null
Member@ box87, can you give me/sent me what you have changed and where? This error also seems to effect people that use php 5+, so if your changes fixes these errors, I realy would like to have them
(mauricederegt[at]gmail.com)
About adding menutabs (not pages); it will be in the next release. You can create new tabs in the admin area and drag&drop them around. Only downside is that the tabs won’t be highlighted when you are on the page where the new tab points too. This has to do with the bb_location and knowing-on-what-page-you-are issue (is_pagename) .
It already is possible to automaticly add a menu tab to your list when activating a plugin that has a page on its own (like the memberlist plugin). But I need to do some more testing for this and documentation of how to do this will proberly be released when bbPress 1.0 (with plugin activation) is released (cause the way this works can be changed)…
Also I am thinking of rewriting this plugin after the bbPress 1.0 release to use jQuery. 1.0 uses this libary, so why not make use of this and reduce the extra files needed to drag&drop the tabs around
Well for now, send me your fix so I can put it in the next release. Big things are ahead!
April 23, 2007 at 8:13 am #57117In reply to: BBLD problem
archasek
Memberfinally, i added this code to my script and it works perfectly. line 238:
else {
get_currentuserinfo();
global $user_ID, $user_identity;
if ( $user_ID ) {
echo '<li>» <a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '&page&replies=' . '">' . __("$title_text") . '</a>';
}
else {
echo '<li>» <a href="' . get_option('wpbb_path') . '/topic.php?id=' . $bbtopic->topic_id . '&page' . '">' . __("$title_text") . '</a>';
}hope that’ll help anybody.
April 23, 2007 at 5:39 am #55555In reply to: Hooks & Filters Docu
Sam Bauers
ParticipantI think you started with looking at the wrong plugin.
I’ve got the code here if you want it, if you want a challenge, then *don’t* read on…:
<?php
/*
Plugin Name: Disable registration
Plugin URI:
Description: Disables registration
Author: Sam Bauers
Version: 0.0.1
Author URI:
*/
add_action('bb_init', 'disable_registration');
function disable_registration() {
global $bb;
if ($_SERVER['PHP_SELF'] == $bb->path . 'register.php') {
bb_die(__('Registration is temporarily disabled for this forum.'));
}
}
?>Make a new file from this code and drop it into your plugins folder. You may need to add some values in the header part to allow it to be registered in the admin area.
April 23, 2007 at 5:31 am #57132In reply to: My Forums: Temporada De Patos
benbeltran
MemberApril 23, 2007 at 4:03 am #57140In reply to: Registration Email Not Being Sent – new issue
chrishajer
ParticipantCan you make sure you can still send email from your server? If you have ssh/command line access, you can try this:
php -r 'mail( 'you@yourdomain.com', "subject: test", "message: test", 'From: you@yourdomain.com');'
If you have FTP access, put this into a file called mailer.php (or whatever.php you want) and then navigate to it with a browser”
<html>
<body>
<?php
mail( 'you@yourdomain.com', "subject: test", "message: test", 'From: you@yourdomain.com');
echo "Mail should have been sent, check your inbox";
?>
</body>
</html>Once you know if you can send email from your server, you can move forward.
-
AuthorSearch Results
Wanting to integrate bb and wp more, I hacked up wp’s
comments.php
template to get replies in the forum to show up below posts in the wp section of the site too.This currently requires the bbPress Post plugin.
Fairly simple job: find the corresponding topic, get the replies, and output them. My solution should work for you, too, if you have bbPress post installed and activated as a wp plugin. Code’s below.
I want to make it possible to reply to the topic from the wp section of the site if you’re logged in. Obviously I could make queries to insert the post into the database, but I’d like to use the bb API so it can be validated correctly, hooks are called etc. Not sure how I would go about making it accessible. Currently calling any bb functions returns the “undefined function” error; how can I make them available for use?
Paste this in front of the rest of your wp
comments.php
template:and paste this at the very back:
<?php } //end else conditional for corresponding topic to blogpost ?>
Example here