Search Results for 'code'
-
AuthorSearch Results
-
November 26, 2007 at 6:18 am #61553
In reply to: How Do I Do This?
chrishajer
ParticipantI was looking into this a little bit and ran into something weird. Click on a subforum in any of the cities and see where you end up. Check the breadcrumb navigation. Something doesn’t seem right there.
Also, you should change the a:hover line in your style.css as well. When you hover over a black link, it turns green now. You might want to make that match the red in your logo maybe.
a:hover { color: #006400; }on line 22, change the #006400 to your new hover color.November 26, 2007 at 6:02 am #61552In reply to: How Do I Do This?
chrishajer
ParticipantColor, bold and underline looks good.
I see the latest discussions are gone.
I see a logo but it’s under the login box, in Firefox 2.0.0.9 anyway. I won’t mess with that at all since you are going to redo it. You could move it over with some left-padding in the CSS if you wanted to.
For now, you could do something like add a text link to the website home, like I did here a long time ago:
http://www.riversideinfo.org/forum/
That is a modification to header.php to add that text link, and I think I modified the style.css to move it where I wanted it.
Regarding the cities, where’s livibetter?
(seriously, I haven’t looked at it at all…)
November 26, 2007 at 5:56 am #61551In reply to: How Do I Do This?
chgogrrl99
MemberAlright…this is working great!
I re-added the banner (it’s 760 x106 but I’m thinking of making a new one with the logo and something that says “Home Page” and then linking that to the main site).
And, yes, I did use the code above to make the different cities.
November 26, 2007 at 5:21 am #53529In reply to: Fight Against Auto-Register Robot
chrishajer
Participantsambauers, are you saying I have to move to India or China to get a job like that? More work being taken away from Americans …

Seriously though, I have a few spam users registered every day, and they always link their username to a website, but there are never any posts by them (maybe I delete them soon enough after registering that they never make a post.) So, what good is it creating a user with a link to a website in a profile they never post from? Would a list of users show up somehow in a stock bbPress install where the links there could actually drive traffic to them somehow? I know WHY they do it, but if their username is never shown next to a post, how would the link to their site ever get picked up? I’ve always wondered about that.
November 26, 2007 at 5:14 am #61550In reply to: How Do I Do This?
chrishajer
Participant> 1. I’d like to add our logo with either a button
> that says “Home” or something indicating back to
> the main page. I tried to add the logo included
> in a banner, but it wasn’t aligned correctly.
Try inserting it again so people can see it and help you get it aligned properly
> 2. I’d like to make the green lettering a bolder
> Color, maybe even change the size of the font.
In your theme, find this around line 21 and change to whatever you like:
a { color: #2e6e15; text-decoration: none; }
a:hover { color: #006400; }You can change the color and font weight and size there.
> 3. I’d like to eliminate “Latest Discussions”
> entirely.
In front-page.php, on line 11, change this:
<?php if ( $topics || $super_stickies ) : ?>to this
<?php if ( 0 > 1 ) : ?>That originally said “if there are topics or super_stickies” then do the rest, which is show the latest discussions. Changing it as shown will cause it to never show “Latest Discussions” because zero is never greater than one (the statement always evaluates false so the code block is skipped). If you want to actually rip out the code that would display the Latest Discussions, you would delete lines 12 to 41 in the file front-page.php in your theme. Those are the line numbers in the stock file, your line numbers might be different. Delete from
<?php if ( $topics || $super_stickies ) : ?>to
<?php endif; // $topics or $super_stickies ?>inclusive.
> 4. This message board is huge…Is there a way
> to anchor each city so we can put links on a
> page on the main site. Example: “Click Here To
> Go To the Chicago Forums” and they are taken to
> the Chicago part of the board.
I have to think about that one. I imagine there’s a way to do it, but I haven’t ever done it. Since the name of the city is not a link, you’d have to make that a link to that category, and then suppress the listing of the child forums on the front page. Or, you could just create a new front-page.php that links to only those parent forums. Can you post a link to a screenshot of how you accomplished the different cities like that? Something from your admin panel, or a link to the post here that guided you toward separating things into cities like that?
WAIT: is it this that allowed you to separate the cities? I think livibetter could probably help you do what you want there since that was their code initially.
vafaaaan
MemberYess .. i did it..
Wrote some lines that gets a posts TAGS .. how do i proceed ?
<?php
//
// Fetch a WP posts tags by Kent
//
$db_type = 'mysql';
$db_host = 'localhost';
$db_name = 'xxxxx';
$db_user = 'xxxxx';
$db_pass = 'xxxxx';
// Just picked one, for testing.
$post_id = "6";
@mysql_connect($db_host,$db_user,$db_pass) or die ("Couldnt connect to database!");
@mysql_select_db($db_name) or die ("Couldnt select the requested MySQL table!");
$fetch_post_tags = mysql_query("
SELECT
wp_posts.ID AS POID,
wp_term_relationships.object_id AS RELID,
wp_term_relationships.term_taxonomy_id AS TAXID,
wp_term_taxonomy.taxonomy AS TAXONO,
wp_term_taxonomy.term_id AS TAX_TERID,
wp_terms.term_id AS TERID,
wp_terms.name AS HOT_TAG_NAME
FROM
wp_posts,
wp_term_relationships,
wp_term_taxonomy,
wp_terms
WHERE
(wp_posts.ID = wp_term_relationships.object_id AND wp_posts.ID = '$post_id')
AND
(wp_term_taxonomy.taxonomy = 'post_tag' AND wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
AND
(wp_term_taxonomy.term_id = wp_terms.term_id)
ORDER BY wp_terms.name ASC
") or die ("Cant fetch data!");
if (mysql_num_rows($fetch_post_tags) > 0)
{
$rowid = 1;
echo "<table border="1">";
echo "<caption>WP posts tags</caption>";
echo "<tr style="background-color: #DDEAD5;">";
echo "<th scope="col">Post ID</th><th scope="col">Tag</th></tr>";
while ($blog = mysql_fetch_array($fetch_post_tags))
{
if ($rowid == 1)
{
echo "<tr><th scope="row">" . $blog['POID'] . "</th>";
}
else
{
echo "<tr><th scope="row"> </th>";
}
echo "<td>" . $blog['HOT_TAG_NAME'] . "</td></tr>";
$rowid++;
}
echo "</table>";
}
else
{
echo "Found nothing!";
}
?>Please dont kill me.. im no pro coder..
fel64
MemberYo. That does help, cheers William. It sounds like I’m not getting rid of comments properly. For the ones that show up all duplicate, is the comment_type in the database
comment?vafaaaan, you’re always better off using the API. The actual relationship is this (with table names taken from vague memory) if I recall correctly:
wp_terms lists all the terms, stores data for them
wp_term_type assigns a type to the terms (so it says whether a term is a tag or a category)
wp_term_relationships links a term to an object, like a post
vafaaaan
Memberfel: ok.. to bad .. im trying figure out the relationships in the DB , seems complex. Why isnt there a wp_tags table?
Will you implement it? or should i try do some coding myself?
November 26, 2007 at 1:15 am #61703In reply to: Change Profile information
richsad
MemberI should add that my objective is to change the info collected to be related to the nature of the website. Occupation, Location, and such is not the right data for the website in question.
I also note that these are text fields ONLY. The content creator of this particular website wanted a dropdown question. I talked her out of it, but how would you do something like that?
Lastly, WHERE is it documented how the profile system works if anywhere. I found the source code was all I could find.
November 26, 2007 at 1:13 am #2631Topic: Change Profile information
in forum Installationrichsad
MemberHi. I want to change the data that is collected in the Registration:Profile Information page of bbpress. Some background…
I have a bbpress/WPMU integration. The system is working fine in terms of the two sites being integrated. When a user goes to register for an account on the forum, they are presented with a form with name, email, website, occupation, location and interests. I see in the source code where the associative array is (get_profile_info_keys). So I could modify the fields there, but there must be some “proper” way to change the profile info that is gathered.
I apologize if this is plainly explained somewhere. I can’t seem to find any admin page related to changing the bbpress profile info. I’d prefer to do this the sanctioned way and not modify source files.
Reading other posts I see stuff about plugins and the profile, but surely that isn’t the easiest way to change the nature of the data collected?
November 25, 2007 at 10:08 pm #53526In reply to: Fight Against Auto-Register Robot
Null
MemberSame. I’ve tried this one, but I could still registrate without leaving the webpage field blank

I need something too and fast, cause I am getting at 200! registration spammers already and counting…
_Null
November 25, 2007 at 10:03 pm #61713In reply to: Check if a user is a moderator+
chrishajer
ParticipantHow about
bb_current_user_can('moderate')?November 25, 2007 at 9:53 pm #2632Topic: Check if a user is a moderator+
in forum TroubleshootingBen L.
MemberHow do I? I tried
$user->caps['moderate']and I tried$user->has_cap('moderate'). Neither worked. What am I doing wrong?Edit: never mind, I figured it out.
November 25, 2007 at 8:47 pm #55907In reply to: Plugin: Restrict registration for bbPress
citizenkeith
ParticipantThanks for writing this plugin.

Every time I update the restriction settings, my Private Forum plugin settings are reset to “Open To All.” Not sure if the problem is with this plugin or the Private Forum plugin.
vafaaaan
Memberhmm ok
think ill wait and get back to that page later then..
fel64
MemberHo hum. That’s pretty annoying, isn’t it? I put in a $bbdb->escape() because otherwise some database error would annoy me, but this way may well be worse. I’m not sure what to do; bb gets it nicely encoded through coming through $_POST I think. Still thinking about that one (if anyone knows what is probably quite obvious and tells me, that’d be great).
vafaaaan
Memberhmm.. posts gets n´s all over them…
projects. Please check back later for for more news regarding this.
n
nCode test
n n< ?php n// Testing.. n if (function()) n { etc...[code='php']
n< ?php
n// Testing..
n
if (function())
n
{
etc…fel64
MemberI put this in my template:
<?php if($topic_id = felwptobb( $id ) ) { echo '<a href="' . bbreplylink( $topic_id ) . '">Reply!</a>'; } else { comments_popup_link(' comments', '1 comment', '% comments','',''); } ?>Not at all, it’s a perfectly reasonably question.
November 24, 2007 at 11:46 am #61040In reply to: How to Write BBPress Plugins.
vafaaaan
Memberomg sry ..
add_profile_tab(__(‘Name’), ‘edit_profile’, ‘moderate’, ‘this-file-was-missing.php’);
So many ppl in this forum .. i can’t breathe
November 24, 2007 at 10:27 am #61039In reply to: How to Write BBPress Plugins.
vafaaaan
Memberam i doing it right?
function ed08_tab_add()
{
add_profile_tab(__('ED 08'), 'ed08', 'moderate', 'ed08-template.php');
}
add_action('bb_profile_menu', 'ed08_tab_add');November 24, 2007 at 9:40 am #61038In reply to: How to Write BBPress Plugins.
vafaaaan
Membercant get new profile tab/page link to work..
November 24, 2007 at 8:11 am #61037In reply to: How to Write BBPress Plugins.
vafaaaan
MemberWhat does these?
add_profile_tab(__('Name on tab'), 'whats this?', 'And this?', 'file.php');.
if i call it once in my plugin it will remain until i deactivate it ?
.
Add settings?
bb_update_option('my_options', $options);.
Delete settings?
bb_delete_option('my_options');.
Show notice on admin page?
bb_admin_notice(__('Settings Saved'));November 23, 2007 at 11:00 am #61646In reply to: How to: ddlb of user roles
Null
Member… sorry for asking for help…. thought forums where here for that…
I can’t program, never said I did, I build things with trial and error, learning that way. Reading and trying to understand how and why things works. So if I get just a piece of code I’ll try that and try other suggestions too. I am more a reverse engineer. The site and things I’ve builded can be done in 2 hours if you are a phpprogrammer, I do it in two weeks or more, but I get it done (don’t give up) and am proud if I acomplisch what I wanted.
Assuming someone can program cause his plugin is awesome wont work everytime
. Most things I can figure out myself, but if some small stupid thing like a ddlb takes too much time I am gonna ask the forums (duh). Kinda get the feeling now that, if you can’t program, you shouldn’t do it or ask for help…Like the post above from Chris, you’ve managed to make it work and you are assuming I can figure this out too cause it was apparently easy for you to figure out. But I don’t think like a programmer, it’s hard for an person like me to figure it all out. I don’t know where all code is pulled from or is placed. I use bbpulp a lot to find the needed code, but that isn’t always enough.
I’m glad Chris found an answer, but then I ask: how did you do it? Can you show me the code and explain some of it so I can learn from it…
Better look like it like this, I can build a car, but I don’t know how to construct it. I know I need an engine, but I don’t know how the engine works. I know what it does, I know I need it… and so I puzzel the car together. A mechanic will do it in 1 week, I’ll do it in 1 year…
I am weird, I know

Well I just wanted to get this of my chest and also mention I aint attacking anyone (especially Chris, just jused your post as an excample)
So no hard feelings (from me anyway) and thanks for your time
_Null
November 23, 2007 at 3:54 am #61644In reply to: How to: ddlb of user roles
livibetter
MemberHaven’t you noticed this line from bbPress source (L1296 in template-functions.php)?
$roles = $bb_roles->role_names;I think chrishajer and me thought you knew how to program with PHP (by checking your website). Yes, chrishajer gave you a piece of code that is a hint not a just-can-work code at everywhere. I thought you can code with PHP, and you should be able to put the rest on your own code. However, I was wrong or you think someone else has taken care of the rest for you?
you also need to do
global $bb_roles;, in case you really can not code with PHP.(edit: Sorry for this emotional post to everyone else)
November 23, 2007 at 3:36 am #57097In reply to: Code backtick bug
Arlo
MemberFel -yup, that was apparently the problem
Livi- and that plugin works without borking code. Thanks!
-
AuthorSearch Results