What class do I need to add of change specifically for the date color link while in viewtopic. I can't seem to get this one.

Thanks
Bingiman.

352

(10 replies, posted in General discussion)

I found a way around it. I am just going to use the input instead of the URL's like this:

<input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" tabindex="3" />|<input type="button" onclick="parent.location='register.php'" name="register" value="<?php echo $lang_common['Register'] ?>" tabindex="3" />

This validates.

353

(10 replies, posted in General discussion)

no, because if you look at the code you'll notice that I am using a javascript open/close function and this is why the div has that id. The login box appears only when clicked on in the header. As I mentioned, the code I posted above works. The only problem is that it does not validate. It tells me the error is the form name.

354

(10 replies, posted in General discussion)

Clicking on login does not work. As it is now it works but won't validate as long as <form name="login3" is there. It is a modified login that sites on the header. If I substitute the URL with the input then it works but I want it to be a text link and not an input button. If however I can get the register text link as a button, then that would be great. Have I lost you yet.

Bingiman

355

(10 replies, posted in General discussion)

This is my complete login:

<?php
 
// Show login if not logged in
if($pun_user['is_guest'])
{
    if(!isset($focus_element) || (isset($focus_element) && !in_array('login', $focus_element)))
    {
 
    // Load the language files
    require PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
 
    // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
    $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
 
    $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);
 
?>
<script type="text/javascript">
<!--
function toggle_lsup() {
    var smu = document.getElementById("login_form");
    var smutxt = document.getElementById("login_form_text");
    if (smu.style.display == "none") {
        smu.style.display = "block";
        smutxt.innerHTML = "Close Panel";
    } else {
        smu.style.display = "none";
        smutxt.innerHTML = "Login Panel";
    }
}
//-->
</script>


<div id="loginbox"><a href="javascript:void(0)" onclick="toggle_lsup();"><span id="login_form_text">Login Panel</span></a>
<div id="login_form" style="display: none;">
            <form id="login3" name="login3" method="post" action="login.php?action=in" onsubmit="return process_form(this)">

    <p>

     <input type="hidden" name="form_sent" value="1" />
     <input type="hidden" name="redirect_url" value="index.php" />
     <span class="login-boxes"><?php echo $lang_common['Username'] ?>:</span>
     <input type="text" style="height: 14px;" name="req_username" size="12" maxlength="25" />
     <span class="login-boxes"><?php echo $lang_common['Password'] ?>:</span>

     <input type="password" style="height: 14px;" name="req_password" size="12" maxlength="16" onkeypress="if(event.keyCode==13) document.login3.submit()" />
      <a class="login-name" href="#" onclick="document.login3.submit(); return true">Login</a> | <a class="login-name" href="register.php">Register</a>
    </p>

   </form>

</div></div>

 
<?php
    }
}

356

(10 replies, posted in General discussion)

neh, it doesn't work without the name Matt.

357

(10 replies, posted in General discussion)

Can someone please tell me how I can make this line validate:

<form id="login" name="login" method="post" action="login.php?action=in" onsubmit="return process_form(this)">

It won't accept the name (name) but it is required for the rest of the form which I have posted below:

            <form id="login" name="login" method="post" action="login.php?action=in" onsubmit="return process_form(this)">
    <p>

     <input type="hidden" name="form_sent" value="1" />
     <input type="hidden" name="redirect_url" value="index.php" />
     <span class="login-boxes"><?php echo $lang_common['Username'] ?>:</span>
     <input type="text" style="height: 14px;" name="req_username" size="12" maxlength="25" />
     <span class="login-boxes"><?php echo $lang_common['Password'] ?>:</span>

     <input type="password" style="height: 14px;" name="req_password" size="12" maxlength="16" onkeypress="if(event.keyCode==13) document.login.submit()" />
      <a class="login-name" href="#" onclick="document.login.submit(); return true">Login</a> | <a class="login-name" href="register.php">Register</a>
    </p>

   </form>

Thanks for the help.

Bingiman

358

(105 replies, posted in General discussion)

I guess no one is willing to devote some time to it at present. So sad because we reached so far with it. sad

Do you mean this:

http://punbb.org/forums/viewtopic.php?id=17324

Well, the only thing I changed was the hover over the subject. That was truncated as well but I felt it was better that you could hover over it and see the entire subject line.
Here is the code just in case you wanted it.

<?php

$show = '10';

showRecent($show);

function showRecent($show)
{
    global $lang_common, $db, $pun_config, $pun_user, $db_prefix;
    $max_subject_length = 20;

    $order_by = 't.last_post';
    $forum_sql = '';

    $show = intval($show);

    if ($show > '0')
    {

        // Fetch topics
        $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL '.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        if ($db->num_rows($result))
        {
            while($cur_topic = $db->fetch_assoc($result))
            {
                if ($pun_config['o_censoring'] == '1')
                {
                    $cur_topic['subject'] = censor_words($cur_topic['subject']);
                }

                if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                {
                    $subject = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).'...';
                }
                else
                {
                    $subject = $cur_topic['subject'];
                }
                echo '<br />';
                echo '<div class="l_icon"><strong><a class="l_icon_padding" href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject).'</a></strong></div><br /><div style="padding-left: 12px; font-size: 9px; font-family: Tahoma, Arial, Verdana; text-align: left;">by: '.pun_htmlspecialchars($cur_topic['poster']).'<br />'.format_time($cur_topic['last_post']).'</div>'."\n";
            }
        }
    }
}

?>

Matt, please ignore my last post. I am an idiot. I am counting replies instead of actual posts so that is why it was not showing more than 4. Sorry about that.

Bingiman

With this preview feature, doesn't it just take you right back to the post area? It would be better if it was based on ajax and remain on the same page.

As a matter of fact Matt. It only displays (4) posts. it doesn't matter what I set it to.

Thanks Matt. it works now. Question: Why is it that when I set it to display 5 it only displays 4. I know it has something to do with the censoring are because if I remove it 5 is 5. Any ideas?

Thanks again.

Hi Matt,

I only had one post on my test site last night and your mod did display it. However, it only shows that 1 even though I have it set to 10. So something is wrong somewhere with the code.

Bingiman

Not sure you guys were aware of this one. They did a great job with pun.

http://forum.mootools.net/index.php

It works great now. Thanks Matt.

I had to add $show to this line: showRecent(---inside here---);

I get the following:

Warning: Missing argument 1 for showrecent() in c:\punbb\include\user\latestposts.php on line 7

I modified it a bit to get it to work and this is the end result:

<?php

LatestPosts(); 

function LatestPosts() {
global $lang_common, $db, $pun_config, $pun_user, $db_prefix;

    $max_subject_length = 20;         // Set amount of words to be displayed before truncation.
    $show = 10;                 // Set amount of posts to be displayed here.
    $order_by = 't.last_post';
    $forum_sql = '';



if ($show > '0')
    {
// Fetch $show topics
        $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL '.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        if ($db->num_rows($result))
        {
            while($cur_topic = $db->fetch_assoc($result))
            {
                if ($pun_config['o_censoring'] == '1')
                {
                    $cur_topic['subject'] = censor_words($cur_topic['subject']);
                }

                if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                {
                    $subject = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
                }
                else
                {
                    $subject = $cur_topic['subject'];
                }

                echo '<div class="l_icon"><strong><a class="l_icon_padding" href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($subject).'">'.pun_htmlspecialchars($subject).'</a></strong></div><br /><div style="padding-left: 12px; font-size: 9px; font-family: Tahoma, Arial, Verdana; text-align: left;">by: '.pun_htmlspecialchars($cur_topic['poster']).'<br />'.format_time($cur_topic['last_post']).'</div><br />'."\n";

                return;
            }
        }
    }
}

I don't know if it is correct.

yes, just a white screen.

It just show nothing. There is just white space and nothing else.

Hi Matt,

I tried the code but it didn't work. It shows nothing at all.

As for my sarcasm in my previous post. It was merely a way of getting someones attention. As a webmaster of a website with over 34,000 members. Trust me, I know what it is like to be bogged down with support questions and people wanting an immediate response. On the other hand, I do understand that people have lives. I unfortunately have none because this is all I do as far as my http://phpfusion-themes.com site is concerned. Sad but true.

Anyway, if I offended anyone then I apologize. big_smile

Bingiman

I will do that.. thanks Scot

Thank you for the overwhelming response I got here on this matter.