Search Results for 'code'
-
AuthorSearch Results
-
December 14, 2006 at 5:34 pm #52463
In reply to: renaming index.php messes up lay-out?
ear1grey
Member<li<?php
if ( is_front())
{
echo " id="current">";
?>
BTW the list item would be better described as being something like
class="current"
then add an appropriate.current {}
to your css.See also: https://bbpress.org/forums/topic/250
December 14, 2006 at 4:32 pm #52462In reply to: renaming index.php messes up lay-out?
ardentfrost
MemberIt sounds like what you need is to overload the bb_get_location function. This is easy to do in bbpress. You need to make a set of functions like this:
is_home() {
if( 'home-page' == get_bb_location() )
return true;
else
return false;
}
get_home_location() {
if ( bb_find_filename($_SERVER['PHP_SELF']) == 'home.php' )
return 'home-page';
}
apply_filter( 'get_bb_location', 'get_home_location' );
That’s untested, but I think that should work. Basically what you want to do is add in your locational test when bb_location is called. Then you can just call is_home() and it’ll do what you want. Of course, if you don’t want any other part of the forum to care if it’s on the home or not, you can take out all that stuff at the end that integrates it with get_bb_location, and just do this:
is_home() {
if( 'home-page' == get_home_location() )
return true;
else
return false;
}
get_home_location() {
if ( bb_find_filename($_SERVER['PHP_SELF']) == 'home.php' )
return 'home-page';
}
Whichever you want to do. The second is easier, the first is more versatile.
December 14, 2006 at 12:26 pm #52461In reply to: renaming index.php messes up lay-out?
Null
MemberQuote:
What does it matter that what bbpress sees at “front-page” isn’t the actual front page of your site? It’s just a moniker used throughout the program, it doesn’t have to mean anything to you.
Well wrong, I am working on a menu for the forum and it defeniatily is important that the call back is accurate.
Some excample code menu:
<li<?php
if ( is_front())
{
echo " id="current">";
?>
<a href="<?php option('uri'); ?>">Forums</a>
<?php
}
?></li>
Here you can see is_front and we also have is_forum so I need to add is_home aswell in order to make the menu work
Well I understand your explaination of how things work. I started home.php from index.php and edited/deleted things i didn’t need to make my own startpage. I also wanted to keep the normal index file, thats why I renamed them. Unfortunally the addons i did in the template functions don’t work unless i keep it like this:
case 'home.php' :
return 'front-page';
break;
And then the id won’t work too, cause
is_front()
is called (and not is_home) so it gets the front-page id.Well going to release my project very soon (as soon as I found a solution for my DIV problem), perhaps you can help me better then.
Really appreciate the time helping me out!!
Null
December 14, 2006 at 12:04 pm #52460In reply to: renaming index.php messes up lay-out?
ardentfrost
MemberWhat does it matter that what bbpress sees at “front-page” isn’t the actual front page of your site? It’s just a moniker used throughout the program, it doesn’t have to mean anything to you.
Not a lot needs to change when adding a new page. Make a file in your forums root directory call it whatever, like null.php. set it up like this:
<?php
require_once('./bb-load.php');
***[if you need any code, put it here]***
if ( file_exists(BBPATH . 'my-templates/nullsfile.php') ) {
require( BBPATH . 'my-templates/nullsfile.php' );
} else {
echo "File does not exist in my-templates folder";
}
?>
Then make a file in your my-templates folder called nullsfile.php and make it look like an html file, but be sure to set it up like this:
<?php bb_get_header(); ?>
***[put all your html code here with calls to php functions]***
<?php bb_get_footer(); ?>
At that point, you have a page integrated into bbpress. What you do in those two files is up to you. To access the file, you just go to forumsroot/null.php (if you have pretty links turned on, you don’t need the .php part). If you need called functions, standard is to put them into a file in the my-plugins folder.
In some of the plugins I’ve made, my main file does stuff like detects if something is set in the address line by checking the $_GET[] variable, or it pulls information needed by the required my-templates file by running a database query…
That all make sense?
December 13, 2006 at 10:18 pm #52403In reply to: Posting Form Disappears
Justin Tadlock
ParticipantOkay, I’ve done that. Here’s what I get on both page 1 and page 2.
$page = 1
$topic = Object
December 13, 2006 at 10:11 pm #52456In reply to: renaming index.php messes up lay-out?
ardentfrost
Memberbecause of the function
is_front()
. It returns true ifbb_get_location
returnsfront-page.php
.December 13, 2006 at 9:17 pm #51508In reply to: FeelingGray Theme
pilkster
Memberbut i think we should some how figure out a way to integrate the themes for wordpress and forums..
Great idea
December 13, 2006 at 9:10 pm #49547In reply to: Plugins for WordPress integration
pilkster
MemberHi again Trent
I’ve had another go. Here are the steps I have taken:
Created a new account on my server (taxdeduct.net)
Installed WP 2.0.5 via fantastico
Downloaded BB from this site
Created database and user through cpanel. Added user to database with all privileges >> sidenote: https://bbpress.org/documentation/installation/ does not mention setting up the database. A bit confusing.
Copied config-sample.php to config.php, edited with my info
Uploaded to host
Ran bb-admin/install.php
Downloaded https://trac.bbpress.org/attachment/ticket/438/bbpress-integration.php – uploaded to WP plugins dir, activated and configured with tables prefix.
Created new user on bbpress… couldn’t log in to WP.
Created new user on WP… couldn’t log in to bbpress.
My head hurts from pulling at my hair
Another question: do you have to allow new user registrations on your blog for the plugin to work?
December 13, 2006 at 8:00 pm #52455In reply to: renaming index.php messes up lay-out?
Null
MemberWhy doesnt this work? Re-checked the functionsfile 3 times now, but no where else in the file it asks for this.
I am experimenting with this new home.php page and adding these new functions to the file and renaming front-page.php aint solving the problem.
What files more need to be changed in order to make home.php and home-page.php work just like index.php and front-page.php (which I renamed)?
Thx
edit:
Changing:
case 'home.php' :
return 'home-page';
break;
to
case 'home.php' :
return 'front-page';
break;
Fixes the lay-out mess up, but still… WHY? Why doesn’t the renamed file home-page.php (front-page.php) work when the return is changed too?
December 13, 2006 at 7:47 pm #52454In reply to: renaming index.php messes up lay-out?
ardentfrost
Memberwhy would you have it return
home-page
when everything is expectingfront-page
?December 13, 2006 at 6:06 pm #52453In reply to: renaming index.php messes up lay-out?
Null
Memberwell I found the function and added this one:
case 'home.php' :
return 'home-page';
break;
Where home-page is the front-page renamed aswell but this aint working either, it’s still messed up
December 13, 2006 at 3:38 pm #52452In reply to: renaming index.php messes up lay-out?
ardentfrost
Memberbecause of the function
bb_get_location()
intemplate-functions.php
it returnsfront-page
if$_SERVER['PHP_SELF']
isindex.php
December 13, 2006 at 8:06 am #52326In reply to: A phpBB to bbPress database converter
Anonymous User 133554
InactiveHi,
Have you checked if FILENAME (line 85) is writeable by the server? If it is, try switching EXPORT_TO_FILE to false and AUTO_IMPORT_EXPORTED_DATA to true. As usual, please do always a database backup before.
Hope it helps
December 13, 2006 at 7:24 am #52417In reply to: Plugin Request: Forum Categories..
spencerp
MemberWell, I’ve already been working on the layout, going by phpBB’s layout in general.. http://vindictivebastard.net/images/forumlayout.jpg
I’m just in need of some PHP professionals, to maybe make up a plugin, or a way to hard code the front-page.php file. To assign each specific forum, to the category..?
I was thinking of, maybe some how skipping the “loop” for the current forum “database calls”.. and just hard code it into the front-page, by calling in the forum’s [id’s].. bare in mind, I’m no PHP Pro here.. lol
Anyone think something like that will work, or..?
spencerp
/And yes, my english grammar sucks too! Whee~
December 12, 2006 at 9:59 pm #1090Topic: renaming index.php messes up lay-out?
in forum TroubleshootingNull
MemberHi,
Was just playing around and renamed index.php to home.php. The funny thing is, this simple rename effects the lay-out. Why is that? I mean no coding is touched, the file is just renamed!
Also
<?php new_topic(); ?>
doesn’t display anymore and the underlining of the <h2> tags is gone as well.I am kinda noob, so why does this happen? no css or template is touched, it should work even if index.php is renamed….. not?
What do I need to change so the lay-out and
<?php new_topic(); ?>
will NOT be effected when renaming index.php to home.php?Thx
December 12, 2006 at 8:26 pm #52189In reply to: Adding a right sidebar at front page
Null
MemberOkay almost there. I now have:
#hottags {
float: left;
width: 150px;
overflow-x: hidden;
position: absolute;
}
#discussions {
margin-left: 170px;
width: 420px;
position: absolute;
}
#rightbar {
margin-left: 610px;
width: 150px;
overflow-x: hidden;
position: absolute;
}
The right bar is alligned properly now, BUT the footer is moved up also. So the footer crosses the 3 collumns. All is mixed now, how to get the footer back down again?
Thx
December 12, 2006 at 7:06 pm #51233In reply to: Anonymous post
masterdj
Member<– Need this answer too, it’s really important! Please
December 12, 2006 at 6:32 pm #52188In reply to: Adding a right sidebar at front page
ardentfrost
Memberadd
position: absolute;
in thereDecember 12, 2006 at 3:06 pm #52187In reply to: Adding a right sidebar at front page
Null
MemberGot this now:
#leftbar {
float: left;
width: 150px;
overflow-x: hidden;
}
#discussions {
margin-left: 170px;
width: 420px;
}
#rightbar {
margin-left: 610px;
width: 150px;
overflow-x: hidden;
}
Total width = 760 px just like the header. This should work, but the right column is still displayed underneeth the discussion div (though the rightbar is aligned to the right and there is enough space left for the rightbar to move up :S
December 12, 2006 at 5:35 am #52397In reply to: Posting Form Disappears
Justin Tadlock
ParticipantI’ve narrowed it down the exact problem. Well, I don’t know why, but it seems to be the source. In “header.php” I include with php a file called “menu.php.” Inside of “menu.php” I have my “recent entries” from my wordpress blog. When I delete this particular bit of code everything works fine.
<div class="menu3">
<h3 class="menuHeader">Recent Reviews</h3>
<ul class="list">
<?php $temp_query = $wp_query; ?>
<?php query_posts('cat=3&showposts=10&order=ABC'); ?>
<?php while (have_posts()) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<br />Review by <?php the_author_posts_link(); ?>
</li>
<?php endwhile; ?>
<?php $wp_query = $temp_query; ?>
</ul>
</div> <!-- menu3 -->
When the post limit exceeds 15, is the only time this seems to be a problem. This runs fine on all the other pages, or when the post limit is 15 or below.
December 11, 2006 at 10:25 pm #52449In reply to: 404 errors
Trent Adams
MemberPersonally, I have had issues with this as well. I would suggest creating a .htaccess file and place it in your bbpress root directory and only adding the following to it:
Options +MultiViews
That seems to work for most people. Try that first maybe? If not, maybe check what format you have in your WP .htaccess and try a combination of either the previous code or what rewrite-rules.php spits out for you.
Thanks,
Trent
December 11, 2006 at 4:54 pm #52146In reply to: How to make a menu like the one on this site?
Null
MemberGot a bit further, this is my menu code now:
<div id="navigation">
<ul id="menu">
<!-- To show "current" on the home page -->
<li<?php
if ( is_front())
{
echo " id="current">";
?>
<a href="about.php">About</a>
<?php
}
?></li>
<!-- To show "current" on the forum page -->
<li<?php
if ( is_front())
{
echo " id="current">";
?>
<a href="<?php option('uri'); ?>">Forums</a>
<?php
}
?></li>
</ul>
</div>
I know with
if ( is_front())
i determine that I am on the front-page, but how to call my About page? It’s called about.php.Sec when I am on the front page the Forums button is highlighted, but as soon as i go read a topic, the whole menu disappears. Why is that? the menu should stay and the forums button highlighted (cause I am still in tjhe forum)
Some help plz
December 11, 2006 at 4:47 pm #52442In reply to: blockquote?
Trent Adams
MemberYou should be able to change your style.css to reflect how you want your blockquote to work. I changed mine and see no problems with it. Take a look at:
http://forum.trentadams.ca/topic.php?id=313&replies=1#post-483
Used:
blockquote {
border-left: 1px solid #c00;
border-right: 1px solid #c00;
border-top: 1px solid #c00;
border-bottom: 1px solid #c00;
background: #fff;
width: 300px;
margin-left: 1.5em;
padding: 5 5 5 5px;
}
Is that what you mean or could you give an example?
Trent
December 11, 2006 at 1:05 pm #51375In reply to: Plugin – Messengers
topiq
Memberthere are some SQL syntax errors. it works if u change the SQL query to this one:
ALTER TABLE bb_users ADD user_icq VARCHAR( 255 ) NOT NULL AFTER user_email ;
ALTER TABLE bb_users ADD user_aim VARCHAR( 255 ) NOT NULL AFTER user_icq ;
ALTER TABLE bb_users ADD user_msn VARCHAR( 255 ) NOT NULL AFTER user_aim ;
ALTER TABLE bb_users ADD user_yahoo VARCHAR( 255 ) NOT NULL AFTER user_msn ;
ALTER TABLE bb_users ADD user_gtalk VARCHAR( 255 ) NOT NULL AFTER user_yahoo ;
ALTER TABLE bb_users ADD user_jabber VARCHAR( 255 ) NOT NULL AFTER user_gtalk ;
ALTER TABLE bb_users ADD user_skype VARCHAR( 255 ) NOT NULL AFTER user_jabber ;
December 11, 2006 at 11:55 am #1088Topic: blockquote?
in forum Troubleshootingbakedlogdotcom
MemberI don’t know if I’m missing something here or what, but when replying or posting, I see no difference if when I surround a block of text with
or not…<blockquote>
It’s a pain because there is no way to create line separation when posting… you can’t use <br> .. is there a way to customize the ‘Allowed tags’? Please help & thx in advance.
-BHensley
-http://Bakedlog.com
-
AuthorSearch Results