Search Results for 'code'
-
Search Results
-
Hey guys,
Today I managed to display a list of topics on my website. A list of the 10 LAST created topics.
Here’s the code:
<!-- dit genereert een lijst met topics -->
<div id="recentetopics">
<h2>Recente topics</h2>
<ul>
<?php
global $bbdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_start_time DESC LIMIT 10";
$results=$bbdb->get_results($query);
foreach ($results as $result) {
echo "<li>".$result->topic_start_time." → <a href='/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
}
?>
</ul>
</div>
<!-- einde lijst topics -->The problem I’m having with this code is the layout of the timestamp.
It’s like this:
2010-01-25 00:42:07 → Australische firma bouwt snaarloze gitaar met touchscreen
2010-01-24 22:35:44 → Apoplectic sluit contract met Mexicaans promo bedrijf af
2010-01-24 22:22:45 → Nieuwe video HIM onlineHow can I change that timestamp into something more nice, like “january 25” or something.
Thanks a lot.
So it sounds like the next major release of bbPress will make bbPress a plugin of WordPress … merging bbPress into WordPress and no longer keeping bbPress as an independent/stand-alone product.
I have a few technical questions as such:
1. Since the future is that bbPress will be a plug-in of WordPress, does that still allow bbPress itself to have plugin capability? Because essentially then, any plugin of bbPress would be a plugin of plugin to WordPress.
2. How would other WordPress plugins effect bbPress? Meaning, if I were to use the SuperCache WordPress plugin – would that then cache my content for bbPress even though bbPress is a plugin itself of WordPress … or, if does it mean that if you use the bbPress WordPress plugin, you cannot use any other WordPress plugin?
3. How would the Admin interface look for bbPress within WordPress. Seems like the Admin interface could easily get messing in a hurry when you have essentially 2 admin consoles (WordPress’ itself and then bbPress’ admin interface within WordPress admin).
For what it’s worth, this is what scares me the most about merging bbPress into WordPress.
The original goal of bbPress was to:
– Open Source, always and forever
– Less (code) is more
– Simplicity is a feature
– Speed and security are the foundation of any good user experience
– Put the user first
Currently, bbPress is close (but not quite there) to meeting the original goals above.
My concern is that by making bbPress a plugin of WordPress, it’s DRASTICALLY moves bbPress away from the original goals because we already know that 1) bbPress would be *more* code, 2) much more complicated, 3) definitely slower given you have to load now WordPress and 4) fundamentally, this is not putting the user first.
Just my 2 cents … also, thanks in advance for answering my questions above
I’d like to remove “forums” and “topics” from bbPress permalinks.
This looks ugly:
http://domain.com/forums/forum/name-of-forum/
http://domain.com/forums/topic/title-of-topic/
Therefore I want this:
http://domain.com/forum/name-of-forum/title-of-topic
Therefore I downloaded a plugin and followed the steps described on this website:
Unfortunately I don’t get it work. I think there are some mod rewrites missing. Unfortunately I am not a mod rewrite expert. Is there anybody who could help me?
Thats the htaccess code which works with the ugly url:
# BEGIN bbPress
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forum/
RewriteRule ^page/([0-9]+)/?$ /forum/index.php?page=$1 [L,QSA]
RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum/forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^forum/([^/]+)/?$ /forum/forum.php?id=$1 [L,QSA]
RewriteRule ^forum/?$ /forum/ [R=302,L,QSA]
RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /forum/topic.php?id=$1&page=$2 [L,QSA]
RewriteRule ^topic/([^/]+)/?$ /forum/topic.php?id=$1 [L,QSA]
RewriteRule ^topic/?$ /forum/ [R=302,L,QSA]
RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /forum/tags.php?tag=$1&page=$2 [L,QSA]
RewriteRule ^tags/([^/]+)/?$ /forum/tags.php?tag=$1 [L,QSA]
RewriteRule ^tags/?$ /forum/tags.php [L,QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /forum/profile.php?id=$1&page=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ /forum/profile.php?id=$1&tab=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /forum/profile.php?id=$1&tab=$2&page=$3 [L,QSA]
RewriteRule ^profile/([^/]+)/?$ /forum/profile.php?id=$1 [L,QSA]
RewriteRule ^profile/?$ /forum/profile.php [L,QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /forum/view.php?view=$1&page=$2 [L,QSA]
RewriteRule ^view/([^/]+)/?$ /forum/view.php?view=$1 [L,QSA]
RewriteRule ^rss/?$ /forum/rss.php [L,QSA]
RewriteRule ^rss/topics/?$ /forum/rss.php?topics=1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/?$ /forum/rss.php?forum=$1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/topics/?$ /forum/rss.php?forum=$1&topics=1 [L,QSA]
RewriteRule ^rss/topic/([^/]+)/?$ /forum/rss.php?topic=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/?$ /forum/rss.php?tag=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/topics/?$ /forum/rss.php?tag=$1&topics=1 [L,QSA]
RewriteRule ^rss/profile/([^/]+)/?$ /forum/rss.php?profile=$1 [L,QSA]
RewriteRule ^rss/view/([^/]+)/?$ /forum/rss.php?view=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /forum/index.php [L]
</IfModule>
# END bbPress
Thats the htaccess code which should make pretty urls:
# BEGIN bbPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forum/
Options +FollowSymlinks
RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ tags.php?tag=$1&page=$2 [L,QSA]
RewriteRule ^tags/([^/]+)/?$ tags.php?tag=$1 [L,QSA]
RewriteRule ^tags/?$ tags.php [L,QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&page=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ profile.php?id=$1&tab=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&tab=$2&page=$3 [L,QSA]
RewriteRule ^profile/([^/]+)/?$ profile.php?id=$1 [L,QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ view.php?view=$1&page=$2 [L,QSA]
RewriteRule ^view/([^/]+)/?$ view.php?view=$1 [L,QSA]
RewriteRule ^rss/?$ rss.php [L,QSA]
RewriteRule ^rss/forum/([^/]+)/?$ rss.php?forum=$1 [L,QSA]
RewriteRule ^rss/topic/([^/]+)/?$ rss.php?topic=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/?$ rss.php?tag=$1 [L,QSA]
RewriteRule ^rss/profile/([^/]+)/?$ rss.php?profile=$1 [L,QSA]
RewriteRule ^page/([0-9]+)/?$ ?page=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/page/([0-9]+)/?$ topic.php?id=$2&page=$3 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/?$ topic.php?id=$2 [L,QSA]
RewriteRule ^([^/]+)/page/([0-9]+)/?$ forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ forum.php?id=$1 [L,QSA]
</IfModule>
# END bbPress
Whats missing in the second htaccess code? It must be something with “page”, “forum” or “topic”.
– I put BBPress into a folder called /forum off of the root.
– WordPress is on the root.
I am trying to use the same database to install BBpress into as WordPress.
I’ve checked with host and my DB name, username, password are all correct. I’ve also copy pasted the DB Host into the advanced settings field.
I still get a msg back that there was a problem connecting to the database. Any suggestions? The only thing I can think of is I’ve installed in a folder that I shouldn’t have? Or I need to specify a path or something?
any help is much appreciated!