Search Results for 'code'
-
AuthorSearch Results
-
July 28, 2007 at 9:28 pm #59520
In reply to: subforums and markup
fel64
Memberfel64, the string is internal to bbpress, not the template loop.
Fair enough, shoulda checked that. So I went and looked through the code, you know, to find the problem. bb has quite an interesting structure there. Couldn’t find the problem, though, so I looked at the code in the .8.2.1 version and it’s missing a bit.
It’s fixed in trunk. Claire, upgrade to the latest version and it’ll work just fine.
July 28, 2007 at 8:44 pm #51568In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Membersure, here is line 13:
foreach($forum_one_topics as $topic) :
and here is the surrounding stuff:
<h2><?php _e('Latest Post'); ?></h2>
<?php
$forum_id = 1;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,1") ?>
<?php
foreach($forum_one_topics as $topic) :
$forum_one_topic_posts = get_thread( $topic->topic_id); ?>
Re: <a>"><?php topic_title(); ?></a>
<span class="gray">
<a>">
<?php echo $topic->topic_last_poster_name; ?></a> said:</span> <span class="justify"><?php echo $forum_one_topic_posts[0]->post_text;
endforeach;
?></span>July 28, 2007 at 6:29 pm #59432In reply to: not getting pagination links on forum pages
_ck_
Participantfel64, the string is internal to bbpress, not the template loop.
Look at forum.php template to remind yourself
<?php while ( bb_forum() ) : ?>
<tr<?php bb_forum_class(); ?>>$forum is being treated as a global and not reset back.
I could remember and reset $forum I guess before and after the while-loop $temp=$forum; loop-here; $forum=$temp; but that’s an ugly hack. It’s got to be fixed in the core and that’s beyond my knowledge of bbpress.
July 28, 2007 at 6:28 pm #59516In reply to: subforums and markup
_ck_
Participantfel64, the string is internal to bbpress, not the template loop.
Look at forum.php template to remind yourself
<?php while ( bb_forum() ) : ?>
<tr<?php bb_forum_class(); ?>>$forum is being treated as a global and not reset back.
I could remember and reset $forum I guess before and after the while-loop $temp=$forum; loop-here; $forum=$temp; but that’s an ugly hack. It’s got to be fixed in the core and that’s beyond my knowledge of bbpress.
July 28, 2007 at 6:10 pm #59513In reply to: subforums and markup
fel64
MemberYup. Just don’t display the forum if
$forum->forum_parent
is true. Change the bit in your templates that goes like this:<?php foreach( $forums as $forum ) : ?>
//blaaaaah HTML
<?php endforeach; ?>to this sort of thing:
<?php foreach( $forums as $forum ) :
if( !$forum->forum_parent ) { ?>
//blaaaaaah HTML
<?php }
enforeach; ?>(ugh colon syntax)
[Edit] Beat me to it ck (by the way, blockquote is already allowed and you’re overwriting it. Doesn’t really matter but could add conflict problems if someone wants to allow it to have attributes). Claire, worth mentioning that this method means it will ignore any subforums without you having to tell it it’s a subforum.
Claire, markup is like this:
<anytag>
your text here</anytag>
so actually HTML tags go between < and >. Actual code, like php code, will be shown as code if you put backticks around it.
You can also use a simplified markup like http://www.loinhead.net/files/felise (just copy that into a plugin file and activate), which means that *this* is bold, _this_ italic and this@someurl turns into
<a href="someurl">this</a>
, etc. More on that https://bbpress.org/forums/topic/markdown?replies=10July 28, 2007 at 6:06 pm #59512In reply to: subforums and markup
_ck_
ParticipantIf you are trying to use <b> instead of “strong” it won’t work because it’s not the “leet” xhtml standard that bbpress wants to enforce. But you can trick bbpress to allow it with this tweak:
function allow_extra_tags( $tags ) {
$tags['del'] = array();
$tags['strike'] = array();
$tags['s'] = array();
$tags['b'] = array();
$tags['i'] = array();
$tags['u'] = array();
$tags['bq'] = array();
$tags['blockquote'] = array();
$tags['pre'] = array();
$tags['hr'] = array();
return $tags;
}
add_filter( 'bb_allowed_tags', 'allow_extra_tags' );note as you can see I allow other tags too
July 28, 2007 at 6:05 pm #59511In reply to: subforums and markup
_ck_
ParticipantIf you mean so topics in sub-forums do not show up on “latest discussions” I whipped this up to solve that:
function filter_front_page_topics($where){
// $exclude_forums=array ("8"); // enable this to manually specify specific forums by id #
$forums = get_forums(); foreach ($forums as $forum) {if ($forum->forum_parent) {$exclude_forums[]=$forum->forum_id;}} // exclude ALL sub-forums
if ( is_front()) {foreach($exclude_forums as $forum) { $where.=" AND forum_id != ".$forum." "; }}
return $where;
}
add_filter( 'get_latest_topics_where', 'filter_front_page_topics');
add_filter( 'get_latest_posts_where', 'filter_front_page_topics');July 28, 2007 at 5:18 pm #59498In reply to: Working on new theme…
moopress
Memberthis is nice. good job. keep working
Dont have any suggestion sorry
July 28, 2007 at 3:52 pm #59468In reply to: Install was successful but….
fel64
MemberNo-one knows anything about writing plugins when they start writing them.
You said you were learning PHP, this is your chance to put it into practice/get better. This might not work but it’s the basic way you’d go about it I think.
add_action('register_user', 'myfunctiontochangeuserstatuswhentheyregisterheh');
function myfunctiontochangeuserstatuswhentheyregisterheh( $user_id ) {
//I suspect somethin' like this:
$user = get_user( $user_id );
$user->set_role('inactive');
}July 28, 2007 at 1:08 pm #54848In reply to: file attachments….
mazdakam
MemberListen!
i know the way of bbpress minimalistic design and minimalistic develop so
we need attachment feature for our support to wp users sometimes they need to upload their file to show and share them it comes form my experience now lets gather to make attachment plugin
something like wp attachment any ideas?
July 28, 2007 at 12:39 pm #58906In reply to: Why “favorites” ? Bad terminology choice?
mazdakam
Memberha ha i agree with _ck_ i also trasnlated favorite to subscribe (peygiri – پیگیری)
it is much better
July 28, 2007 at 12:22 pm #51565In reply to: Full Content of Most Recent Post on Front-Page?
fel64
Member$topic->topic_last_poster
is the ID of the last poster to the topic.user_profile_link( $user_id )
echoes the url of the user’s profile. You’d do something like this I think:<a href="<?php user_profile_link( $topic->topic_last_poster ); ?>"><?php echo $topic->topic_last_poster_name; ?></a>
July 28, 2007 at 12:19 pm #52655In reply to: Plugin: [REL] Signature
ganzua
Member“or there is a large demand.”
well, I’m not large but I do demand
“It’s very easy to apply filters to the signature just like the post text, smiles, auto-close tags and a whole bunch of other tweaks and security could be easily added.”
and all these too
July 28, 2007 at 11:29 am #59485skipdaddyo
MemberYou’re spot on – the flag approach it must be…
Topic Count (and probably Post Count) is driven by a hard coded sql value that is incremented each time a topic is added a decremented when one is deleted…
July 28, 2007 at 11:28 am #59484_ck_
ParticipantSee that’s the thing, you won’t be able to pre-guess everywhere it will show up. Any future plugins will not know to obey your time logic.
However most code should know to check for topic_status==0
If you set it higher and then set it back when the time is right, then you should be able to get around all functions. Just don’t use 1 or 2 as a marker.
Then every few minutes do a mysql check for any topics that have that unique number set in topic_status and if their time has past, set topic_status to zero.
That reminds me, bbpress will need a pseudo-cron that can be hooked with a real cron job if so desired.
July 28, 2007 at 10:44 am #59480skipdaddyo
MemberThanks _ck_
After a day of hacking around (my php handicap is 27 afterall), it has been done :o)
To cut a long story short…
I added time and date fields to the post form (visible to moderators only)
Told functions php to carry on as usual unless it sees a year value – otherwise it uses the value it’s given.
The sql query that spits out the posts now only returns a row if the topic_start_time is lower than the time the request was made.
I can supply (very fugly) code if anyone wants to do the same thing.
The reason I wanted this is so I could start a topic or topics – and walk away. As you can with future posts in WP.
July 28, 2007 at 8:43 am #59242In reply to: Plugin: Plugin browser for bbPress
_ck_
Participant>For a lark I pointed the plugin to the WordPress Plugin SVN. It got about 1/4 of the way through retrieving the list of plugins and died (script timeout).
With many people accessing it, yeah it will necessary to pre-compile a default list of a full revision weekly.
Or to be sneaky for now you can set a flag in options after each curl fetch and restart bbpress if you calculate approaching 30 seconds.
Both ways sound like headaches.
I wonder if the trac cache is faster/more efficent?
ie.
https://plugins-svn.bbpress.org/plugin-browser-for-bbpress/trunk/plugin-browser.php
vs.
I wonder if trac can be tricked to pre-gzip it all to download beforehand as a bundled revision? It’s got to compress wonderfully as it’s entirely plain text and repeating php functions.
ps. be sure to take advantage of gzip support in curl / fsockopen – I have some code I wrote somewhere to do this if you need ideas
July 28, 2007 at 7:39 am #59325In reply to: Strange (?) (404) report i Firebug
berniesteak
MemberDid you get anywhere with this either oledole? I can’t figure it, and it doesn’t look like we’re going to get any help!
July 28, 2007 at 4:56 am #51563In reply to: Full Content of Most Recent Post on Front-Page?
outchy
Memberi hear what you’re saying but believe me, i tried my damndest to figure it out myself before i posted (as i do before all my questions). the problem is i don’t really understand the syntax of php code just yet so i don’t know how to use the get_user_profile_link(); function in this particular example (getting the profile link of the last poster from the entire messageboard onto the front page, it’s a little confusing). if you can give me some help on this one, i’d appreciate it.
July 27, 2007 at 10:06 pm #51562In reply to: Full Content of Most Recent Post on Front-Page?
fel64
MemberI don’t know off the top of my head. What I’d do in this case, as for pretty much every question that’s asked, is open my copy of bbPress and look around in the files. So that sort of thing sounds like a template tag, so I’d look at bb-includes/template-functions.php, then search for “profile_link” or a couple other similar terms if I couldn’t find it.
This time I tested it and searching for “profile_link” will pretty quickly get you the function you want. But finding out what you need is something you can pretty easily do yourself most of the time.
(Not that there’s a problem with you asking anything, this is just teach-a-man-to-fish thinkin’.)
July 27, 2007 at 9:58 pm #59456In reply to: how can i define a .mo file for a plugin
mazdakam
MemberNo! it is not nessecary to merge all files into one file!
just we need to name the mo files into our main mo file for example fa_IR
and put each mo file into plugin or template folder and it will be work
July 27, 2007 at 7:34 pm #59455In reply to: how can i define a .mo file for a plugin
mazdakam
Memberoh
this is bad news for me but i will try it
i think it was much better that each plugin and template had separate and independent language like joomla components
July 27, 2007 at 4:38 pm #59448In reply to: How to link to favorites of logged user
_ck_
ParticipantActually, forget that way.
I just checked the source and it’s right there for us:
<? if (bb_is_user_logged_in()) { echo '<a href="'.get_profile_tab_link(bb_get_current_user_info( 'id' ), 'favorites' ).'">favorites</a>'; } ?>
much better
July 27, 2007 at 4:22 pm #59446In reply to: How to link to favorites of logged user
_ck_
Participantone quick & dirty way:
<? if (bb_is_user_logged_in()) { ?><a href="<? echo $bb->uri.'profile.php?id='.bb_get_current_user_info( 'id' ); ?>&tab=favorites">favorites</a><? } ?>
July 27, 2007 at 2:29 pm #2174Topic: {Request plugin:} auto complete tags
in forum Requests & Feedbackmazdakam
Memberevery one knows that tags are important but we know that writing tags for users are not easy sometimes so we need auto complete tags features
to show and suggest tags when user type letters it would be 4 advantages
1) fast taginig
2) user friendly gui
3) saving user time
4) waiting for number 4.. no more finished
-
AuthorSearch Results