Search Results for 'code'
-
Search Results
-
Hi,
Welltried to make a plugin, but it aint working, why not?
Plugin code:
<?php
function get_portal_topics () {
global $bbdb;
return $bbdb->query("SELECT * FROM $bbdb->topics WHERE forum_id = 1 ORDER BY topic_time DESC LIMIT 0,10");
}
?>
This has to give a list I need, but turning it into my template it get this error:
Warning: Invalid argument supplied for foreach() in /bbpress/bb-templates/portal-page.php on line 33
Template code:
<?php $portal_topics = get_portal_topics() ?>
<?php foreach($portal_topics as $topic) :
$portal_topic_posts = get_thread( $topic->topic_id); ?>
<h1><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></h1>
<?php printf(__('%1$s - <a href="%2$s">%3$s</a>'), get_topic_time(), get_user_profile_link($topic->topic_poster), get_topic_author()) ?><br/>
<?php echo $portal_topic_posts[0]->post_text; ?>
<div align="right"><?php printf(__('<a href="%1$s">Comments (%2$s)</a>'), get_topic_last_post_link(), get_topic_posts()) ?></div><br/>
<?php endforeach; ?>
Or my plugin is all wrong, or how I call it…. or both
Thx
Topic: ajax killed?!
Hey
I started translating bbPress to German and maybe I found a bug, but … at the moment I don’t know how it comes and how to fix it.
All ajax features (tags, favorites …) are no longer working. Thy act as if there is no javascript enabled. Also some of the functions wont work anymore (can’t add/removed favorites …) …
Has somebody any idea why this happens? … Any idea to fix it??
Link to Forum: http://la-school.com/bbpress/
Edit:
Sorry folks … this must have something to do with Flock … in FF it works fine, even in german -.-“
I’ve installed bbpress with wordpress integration, the database integration works correctly thanks your guide. But… when i try to see my posts i have this error:
(
Parse error: syntax error, unexpected $end in /home/mhd-01/www.alessandropagano.net/htdocs/blog/wp-includes/gettext.php(307) : eval()’d code on line 1
1 post)
you can try to show this at http://www.alessandropagano.net/blog/forum/
I’ve heard that this could be related with language settings… but my config.php have the default setting (define(‘BBLANG’, ”)
Thanks in advance, i hope to hear you soon!
My first bbPress Template:
http://www.borderline-hacks.at/borderline-hacks-forum/
The image of it:
http://www.weirdtherapy.com/images/borderline-green-01-shot.jpg
If you want to download it to (change and) use it, you can do so here:
http://www.weirdtherapy.com/zip/borderline-green-ads-01.zip
There is (commented) space where you may place ads, I added the psd file for the logo, and the text in the header is random (to be truth I only added it because I couldn’t think of anythink else and I wanted it to be finished
) and easy editable(… i think / hope). There is also a seperate ie.css for the internet explorer.
Two of the ads would be shown on every page because they are in the header – I only ad this information cause I think I read somethink in the forum here that there might occur problems with google .. well something like that – so keep that in mind pls.
grretings
Topic: Not Resolved by Default
I’ve been looking for a way to start off topics as “Not Resolved” by default, with no luck. Went through all the template files looking for the
<select>
also to no avail. Any ideas how to accomplish this? (Also, searched the forums). Thanks for any help.Well, I am trying to ad an adminpage to bbPortal. I am quite far, got the admin page, it checks the db for the table bb_portal and if it doesntexcsits, it creates the table.
Also the form is working (the looks anyway), but how do I get the forum id from <?php forum_dropdown(); ?> cause it gives the name only. And I want it that when people select the forumname using this ddlb the forum id will be written to
pforum_id
when pressing submit.Sec problem; people can fill in a number for the Number of topics on the portal in an input field, but now comes the noob question:
How the hell do I update this input to the db?
This is my form for now:
<form action="<?php echo $bb->domain. $_SERVER['REQUEST_URI']; ?>" method="post">
<?php do_action('portal_option_form_elements',''); ?>
<h3><?php _e('Portal settings'); ?></h3>
<table>
<tr><th scope="row"><?php _e('Where do you want to pull the topics from?'); ?></th>
<td><?php forum_dropdown(); ?></td>
</tr>
<tr><th scope="row"><?php _e('Number of topics on the portal:'); ?></th>
<td><input type="text" name="number-of-topics" id="number-of-topics" /></td>
</tr>
</table>
<p class="submit alignleft"><input type="submit" value="Submit" name="submit">
</form>
And this is the table where the info must be put in:
Table name: $bbdb->portal
pforum_id int(10) NOT NULL,
number_of_topics int(10) NOT NULL
Hope you guys can help me