o.O;;
strange, lol. i must have dreamed it ^^;;;
well thanks ^.^

i could have sword punBB had a do html tag, but i cant find info on it anywhere. can someone tell me where so info on it is, or if there is one?

does anyone know where this happens?

how do i do that? o.o;;

5

(1 replies, posted in Programming)

so how do you get the <select> box to automatically submit its info without hitting the submit button? like the Jump To does on here.

i modified this from the show topic mod here: http://wiki.punres.org/Last_post%27s_su … orum_index
edit your index.php and find:

// If there is a last_post/last_poster.
    if ($cur_forum['last_post'] != '')
        $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
    else
        $last_post = ' ';

and replace with:

// If there is a last_post/last_poster.
    if ($cur_forum['last_post'] != '') {
        $idmT = (isset($idmComp)) ? ' title="'.$idmComp.'"' : ''; 
        
        $result2 = $db->query('SELECT users.id FROM '.$db->prefix.'users, '.$db->prefix.'forums WHERE users.username=forums.last_poster') or error('Unable to fetch user id info', __FILE__, __LINE__, $db->error());
       $poster_id = $db->result($result2);
        
        $last_post = format_time($cur_forum['last_post']).'<br />in: <a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'"'.$idmT.'><em>'.$idm.'</em></a><br /><span class="byuser">'.$lang_common['by'].' <a href="profile.php?id='.$poster_id.'">'.pun_htmlspecialchars($cur_forum['last_poster']).'</a>';'</span>';
    } else
           $last_post = ' ';

and now you got the topic on the index AND a link to the profile of the one who posted last in it! enjoy =^.^=

ohh, okay, thanks!

i just like having it in the post. so people with dial up dont have to load a differant page to see the gender.
i got a 24k connection, so i know how it is ^^;;

it does actualy, thats why i dont get hy its erroring. i think my SQL sintax is messed up, or my user.am_gender isnt getting to $pun_user['am_gender']

yup! so any idea whats wrong with that code?

umm, bump?

so any idea why i'm getting an error than? did i edit it correctly?

edit:

okay, i fixed that, but its still not showing up >.<

heres my current query:

edit 2: okay, i finally fixed that, but now in post.php, i'm trying to get this code to run when i reply to a topic, but its erroring on me.

$db->query('SELECT am_gender  FROM  '.$db->prefix.'users WHERE user.id = '.$pun_user['id'].';')

or error('Unable to create post', __FILE__, __LINE__, $db->error());

$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, am_poster_gender) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].' , '.$pun_user['am_gender'].')')

or error('Unable to create post', __FILE__, __LINE__, $db->error());

$new_pid = $db->insert_id();

isnt
$user_avatar =':'  .$cur_post['am_poster_gender']. ' end';
the query? can you show me what the query looks like, and where its at in viewtopic.php?

okay, now i understand. i just now edited the query:

$result = $db->query('SELECT u.am_gender, u.cm_cash, u.cm_bank, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS p.am_poster_gender, username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());


i need to get u.am_gender to go into p.am_poster_gender and than p.am_poster_gender to $cur_post['am_poster_gender'] i think, so how would i do that?

cause currently i get a cannot fetch post info error.

oh, and i'm new at this, so if you see a better way please tell me.

i dont really understand that question too much, but i did modify post.php to take in that value from user.php, oh, and i should say that my problem is in viewtopic.php

okay, so i got this value in my posts table am_poster_gender and its a not null varchar(255) and the default is male. but it keeps being read as null


$user_avatar =':'  .$cur_post['am_poster_gender']. ' end';


any idea why?

okay, so i got two websites, and i only wanna do the work for one forum, so i plan on copying all but the config file into my other one, it works okay, but i got to add in the fields to the database on my  own, which is a pain. anyway, i got it working 95%, but theres still on error.

i'm just useing the money mod right now, where you get money per post, and it doesnt see any of the info i added into the config table in my database.

money mod: http://punbb.org/forums/viewtopic.php?id=8988

anyone know why?

working forums: www.dreamradically.com/forums/index.php
broken forums: www.soracross.com/forums/index.php

info in Dream Radically database config table:
      Edit       Delete  cm_lottery_chance      5
    Edit     Delete     cm_bank     1
    Edit     Delete     cm_lottery     1
    Edit     Delete     cm_cur_name     gold
    Edit     Delete     cm_lottery_cost     5
    Edit     Delete     cm_lottery_pot     100
    Edit     Delete     cm_interest     2
    Edit     Delete     cm_lottery_lastwon     No one has won yet.
    Edit     Delete     cm_intereste     1
    Edit     Delete     cm_last_win     1

info in Sora Cross config table:
      Edit       Delete  cm_lottery_chance      5
    Edit     Delete     cm_bank     1
    Edit     Delete     cm_lottery     1
    Edit     Delete     cm_cur_name     gold
    Edit     Delete     cm_lottery_cost     5
    Edit     Delete     cm_lottery_pot     100
    Edit     Delete     cm_interest     2
    Edit     Delete     cm_lottery_lastwon     No one has won yet.
    Edit     Delete     cm_intereste     1
    Edit     Delete     cm_last_win     1




Edit: i fixed it. i undid all the things i hand added to my db and ran the install_mod.php