Search Results for 'test'
-
Search Results
-
I’ve added a “geo” field to the topics table that contains latitude and longitude data for each topic. The topics table now contains lat/lng from different cities all over the US.
I’ve modified forum.php to take latitude and longitude GET parameters to use as a “center.” Then I select topics within range of X miles and order by distance from “center.”
To hack this in I wrote a new function in classes.php called generate_geo_topic_sql. This worked enough so that I can test my idea, but its not a long term solution.
So now I need to somehow integrate this query into generate_topic_sql. I still want to retain the original functionality, but just create a different view if I’m using a “center” point.
This is the query. You can not run multiple statements at once in PHP so each of these queries need to be executed separately.
SET @center = GeomFromText(‘POINT(” . $lng . ” ” . $lat . “)’);
SET @radius = 1;
SET @bbox = CONCAT(‘POLYGON((‘,X(@center) – @radius, ‘ ‘, Y(@center) – @radius, ‘,’,X(@center) + @radius, ‘ ‘, Y(@center) – @radius, ‘,’,X(@center) + @radius, ‘ ‘, Y(@center) + @radius, ‘,’,X(@center) – @radius, ‘ ‘, Y(@center) + @radius, ‘,’,X(@center) – @radius, ‘ ‘, Y(@center) – @radius, ‘))’);
Then this was the “hack” query that I wrote to get it to work. I dumped the SQL from the original generate_topic_sql and grafted on what I needed.
SELECT t.*,SQRT(POW( ABS( X(t.geo) – X(@center)), 2) + POW( ABS(Y(t.geo) – Y(@center)), 2 )) AS distance FROM bb_topics AS t WHERE t.topic_status = ‘0’ AND t.topic_sticky != ‘2’ AND t.forum_id = ‘” . $this->query . “‘ AND Intersects( t.geo, GeomFromText(@bbox) ) AND SQRT(POW( ABS( X(t.geo) – X(@center)), 2) + POW( ABS(Y(t.geo) – Y(@center)), 2 )) < @radius ORDER BY distance ASC LIMIT 3
The problem is that paging does not work (and a few other things) in my hackjob function. I need to find a way to integrate this into the regular function so that I can maintain all the functionality.
Any suggestions?
Hi,
bbpres 0.9.0.2
Im exhausted looking for a solution so i post, after a clean install in hostgator, when I click on Latest Discussions ADD NEW link, while not logged, I get a link similar as:
http://www.domain.com/forum/bb-login.php?re=http%3A%2F%2Fwww.domain.com%2Fforum%2F%3Fnew%3D1
and after clicking on it: I got a WordPress 404 not found page.
I have tried adding and .htaccess in my bbpress directory with Options +MultiViews
I have turned off-on pretty permalinks,
I have installed a wordpress 404 fixer plugin,
But nothing works,
Only if is logged a user the ADD NEW link works.
Please helpme I am on a deadline weekend.
best regards
monica
In forum.php and front-page.php, the latest poster for each topic is identified. Is it possible to also identify the first poster– ie the person who started the thread and perhaps also when the thread was started? After sifting through code for several hours, I’m not sure if I’m overlooking something, or if I simply cannot find something that is not there. Thanks.
Topic: Problem with sticky topics
Hi there,
My bbPress forum (0.9.2) has been theme and databased intergrated, I’ve just decided to test sticky topics, and this occurs on a sticky topic:
http://www.james-blogs.com/forum/topic.php?id=3
What is this [sticky] code doing, Is this meant to be how a sticky topic is identified to someone or is broken bbcode?
Regards,
James
update: I’ve now included this functionality in the topics-per-page plugin so use that instead which is maintained and not this mini-plugin which will not work properly with 1.0a
Here’s something I had made a mental note of quite awhile ago but forgot to do, add pagination to the front-page for the latest discussions. You can see a demo near the bottom of http://bbshowcase.org/forums/
(the following two functions are included in the 0.0.4 version of topics-page-page plugin, so don’t use them if you have that)
add_filter('get_latest_topics_limit','front_page_pagination',999);
function front_page_pagination($limit="") {
global $page;
if (is_front() && $page>1) {$limit.=" OFFSET ".($page-1)*bb_get_option('page_topics');}
return $limit;
}
function front_page_pages() {
global $page, $bbdb;
echo get_page_number_links( $page, $bbdb->get_var("SELECT SUM(topics) FROM $bbdb->forums"));
}1. add to your
front-page.php
template<div class="nav"><?php front_page_pages(); ?></div>
AFTER
<?php endforeach; endif; // $topics ?>
</table>2. If you use rewrite slugs you MUST add the following rule to your
.htaccess
fileRewriteRule ^page/([0-9]+)/?$ /forums/?page=$1 [L,QSA]
anywhere before
</IfModule>
where
/forums/
is the path to your bbpress install.Help, please. A very basic question, maybe a sticky would be a good idea? I have successfully installed and integrated the latest alpha version (as of today) with WordPress 2.6.3, (congratulations to the team) but I can’t figure out how to get into the administration area.
Hi,
I am in the middle of the install of bbPress (latest alpha as of today) and I get asked for the user database table prefix. Looking at my wp-config.php file, all I see is the following:
// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = ‘wp_’; // Only numbers, letters, and underscores please!
Does that mean that I don’t have a WP user database table? What do I need to do? This is my first site and I don’t have any users yet except myself as admin – translation: I am an extreme newbie and just want to get the rest of this install finished.
I am using WordPress 2.6.3
Cheers
Topic: OpenID support coming soon…
I just wanted to announce I have a primitive prototype of OpenID working with bbPress and should have a more stable version for experimental testing within a few days (likely by the end of the weekend). The only requirement is your PHP needs CURL with https (ssl) support, which many servers have or can easily add ie. via cpanel’s rebuild PHP (check your PHPINFO to be certain).
I finally got an old openid 1.1 framework working with openid 2.0 so this makes it possible to use it with all the newest providers: aol, yahoo, microsoft and now even Google (as a “consumer”, not as a server).
The biggest problem was making it work without extra libraries like the complex math support and even DOMXML which is not available on many shared hosting PHP4 servers. But found a way around that too
I’ll eventually add fsockopen support with ssl so even CURL is not a requirement.
ps. OpenID on WordPress.com needs to be fixed to offer a secure login when a cookie is not present like every other provider. This is annoying