Forum Replies Created
-
In reply to: Plugin: bbMenu 0.1 beta
Nice
Btw stubled on the BLIX theme from bbPress. It uses for each (I asked about this in some other posts) in it’s menu and could be the answer of my nr 1 problem.
Some peace of code:
foreach ($pages as $page) {
$page_id = $page->ID;
$page_title = $page->post_title;
$page_name = $page->post_name;
if ($page_name == "archives") {
(is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ' class="selected"':$selected='';
echo "<li".$selected."><a href="".get_page_link($page_id)."">Archives</a></li>n";
}
Now to confert it to this plugin, have to change ‘location’ input to: is_archive() || is_search() etc. Going to play with this
In reply to: query/php problemOkay, I’ll release bbMenu BETA 0.1 next week (I am on holiday this weekend) so we can all see the code and the way it works (it does work ) and I hope we can solve this problem I have…
In reply to: insert/hyperlink fileYes there is, it’s called a WYSISYG editor. WordPress has one, I think (hope) bbPress will get one too. I already have a ticket about this for version 1.0 of bbPress, so time will tell if this gets implemented. If not, someone will (I will do it when I have time for it. I already have a WYSIWYG editor laying around that should be easy te implement into bbPress) make a plugin for this to add a very simple/basic WYSIWYG editor to bbPress.
In reply to: query/php problemHmm got this error now when entered your code:
Parse error: parse error, unexpected $ in /xxx/bbpress/my-plugins/bbmenu.php(123) : eval()’d code on line 1
Thats where the $switch begins…
If you want the beta of my plugin (for code), throw me an email and I will email it (got some uploading problems atm)
email: mauricederegt at gmail.com
In reply to: query/php problemThx going to try that, and well I am no programmer at all, learning along the way. It goes like: Hmm that would be cool for bbPress -> is it possible (YES) -> how to make it? (google ) -> try and error -> try and error -> try and error-> try and error -> getting fed up with it -> post help cry on this forum
I’ll learn along the way
And yes I want it this way, cause it’s only 1 record that looks so clumpsy, all others just have 1 record…
In reply to: query/php problemWell what I dont understand is that THIS works:
<li><a <?php if (is_front() || is_forum() || is_tag() || is_topic() || is_bb_feed() || is_bb_profile() || is_bb_favorites() || is_view())
{
echo "id="current"";
}?> href="index.php">Forums</a></li>
And this aint:
$current = ($rw['location']) ? ' id="current"' : '';
echo '<li ' . $first . '><a href="' . $rw['page'] . '"' . $current . '>' . $rw['item'] . '</a></li>';
Cause ($rw) will give: (is_front() || is_forum() || is_tag() || is_topic() || is_bb_feed() || is_bb_profile() || is_bb_favorites() || is_view()) too
In reply to: query/php problemOkay, I changed the location value with:
is_front() || is_forum() || is_tag() || is_topic()
And changed the code with:
function get_bb_menu() {
global $bbdb;
$menutest = mysql_query("SELECT * FROM $bbdb->menu
WHERE
set= 'active' ORDER BY
orderASC");
And re-written the li part with php:
<li><a <?php if ('location')
{
echo " id="current";
?>
href="<?php ('page'); ?>"><?php ('item'); ?></a>
<?php
}
?></li>
So technically I need to put this in a foreach and it wil be like:
<li><a <?php if (is_front() || is_forum() || is_tag() || is_topic())
echo " id="current"; ?>href="index.php">Forums</a> </li>
<li> <a href="search.php"> Search</a></li>
(the is_front() etc will not be shown ofcourse, but it’s to make it clear)
But how to make such a foreach?
In reply to: Plugins / Templates For bbPress 0.8wow only 6 tickets left, and they aren’t too complexed.. perhaps a fast launch this week after all??
Crossing fingers
Ah fixed it. A same function was declared twice and php doesn’t like that!
Greetz
Found the bug.
When loading the admin it also includes the new file: menuhead.php. In that file there is a line:
<?php ajax_show_javascript(); ?>
and that gives this error: <b>Fatal error</b>: Call to undefined function ajax_show_javascript() in <b>bb-admin/menuhead.php</b> on line <b>6</b>Why is that? Well the new admin page DOES use this ajax_show_javascript but all others don’t. That also explains that only the menu admin page is working and all others aint.
But how the hell can I fix this? Will an if work? If page = admin-base.php?plugin=menu_admin_page include menuhead.php or something? Any other suggestions?
At the moment, menuhead.php is called using a include or is this fixed if I use the new admin_head hook in 0.8?
In reply to: Plugins / Templates For bbPress 0.8Quote:
...the new and improved 0.8 version that should be released pretty soon...
Stop teasing us!!!
In reply to: for each questionGot it fixed, this topic can be deleted
In reply to: for each questionWell this fixes the error but the class isn’t filled in:
- Forums
hmmm going to try something else, thx anyway
In reply to: for each questionStill no luck
I have this:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu
WHERE
set= 'active' ORDER BY
orderASC");
while($rw = mysql_fetch_array($r))
{
$class="";
if ($rw['is']) { $class .=" current" }
echo '<li><a class="$current" href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
Which is the same code as yours, but I still get the error:
Parse error: parse error, unexpected '}' on header.php on line 84
And line 84 contains the if:
if ($rw['is']) { $class .=" current" }
I am totally lost here :S
In reply to: for each questionCan you give me a code example, cause i keep getting the error
In reply to: for each questionHmm got this now:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu
WHERE
set= 'active' ORDER BY
orderASC");
while($rw = mysql_fetch_array($r))
$class="";
if ($rw['is']) { $class .=" current" }
{
echo '<li><a class="$current" href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
But this gives me an error:
Parse error: parse error, unexpected ‘}’ on line 71
Think I have misplaced something here?
Greetz
ps I didn’t include
$uri=option("uri").$rw["page"];
at all cause I wanted to test this first. So I keep it out for now…In reply to: Time FormatAnds how does one change the time from
2007-01-16 18:23:58
to
January 16, 2007
So no time, only date. I have added
<?php topic_time(); ?>
to my frontpage and it shows: 2007-01-16 18:23:58, but on the fronpage (only there) I want to show it like: January 16, 2007Thx
In reply to: for each questionI did that but you can’t use php in an echo:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu
WHERE
set= 'active' ORDER BY
orderASC");
while($rw = mysql_fetch_array($r))
{
echo '<li><a href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
This works perfectly, but now I want to add some php code into
<a
!here the php code!>...</a>
so it will look like this (i only show the echo now):{
echo
<li><a <?php if ('.$rw['is'].')
{
echo "id="current"";
}?> href="<?php option('uri'); ?>'.$rw['page'].'">'.$rw['item'].'</a></li>;
}`
But this aint working cause you cant do php in an echo. Any suggestions?
In reply to: for each questionEuuhh well still can’t get it to work…
I have the function:
function get_bb_menu() {
global $bbdb;
return $bbdb->get_results("SELECT * FROM $bbdb->menu
WHERE
set= 'active' ORDER BY
orderASC");
}
This will give (tabel sperated with – ):
set – item – page – is – order
active – Forums – index.php – is_front() – 0
active – Statistic – statistics.php – is_bb_stats() – 1
active – Search – search.php – is_bb_search() – 2
Now I want this in a for each so it generates (note this is A PART what it should generate):
<li><a <?php if (is_bb_search())
{
echo "id="current"";
}?> href="<?php option('uri'); ?>search.php">Search</a></li>
<li><a <?php if (is_bb_stats())
{
echo "id="current"";
}?> href="<?php option('uri'); ?>statistics.php">Statistics</a></li>
But how to do this???
In reply to: bbPress 0.8Nah it will take some weeks before it’s released, so call down
In reply to: My TemplateYou mean the green background when hovering?
.notice {
border: 2px solid #4c9545;
background: #abd8a2;
color: #4c9545;
font-size: 1.1em;
font-weight: bold;
padding: 10px 15px;
margin: 0 0 1.1em;
}
Not sure though
In reply to: Not latest reply link, but first reply link?Okay I have an idea, it is possible (with a plugin) to add an anchor as soon as some one adds a first reply?
So when replying, it checks first if there is 1 post in the topic. If it is, it adds a anchor (or get its anchor) if it isnt (there are 0 or >2 more posts) it does nothing. Then it can generate a first-reply link…
Well in theory…
In reply to: How does bbPress handel: double variables?Np dude,
Think I am going to release a tutorial when releasing the plugin, explaining how people can add their plugin(page) to the menu. THinks thats the best approach for now!
In reply to: How does bbPress handel: double variables?unreasonable request….. ow sorry
In reply to: How does bbPress handel: double variables?Well they way I want it, makes it possible to auto update the available menu links… Or it has to check every plugin page if it has a page available…
Perhaps its easier to ask this question when I release the plugin…