101

(13 replies, posted in PunBB 1.2 show off)

Almost done the thing smile check it out smile

2 Death Angel: ??, ???? ????? ????, ??? ???? ?????? ??? ???, ????? ??????? ?? ????????? ??? + ??????????? ???????? ???????????? ??? ????? ?????? ? ???????????? ??????.

viewtopic.php
-----8<------
~110 line
if (!$cookie['is_guest'])
$result = $db->query('SELECT t.subject, t.closed, t.sticky, t.num_replies, t.last_post_id, t.last_post, f.id, f.forum_name, f.moderators, f.closed AS forum_closed, f.admmod_only, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (s.topic_id=t.id AND s.user_id='.$cur_user['id'].') WHERE t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT t.subject, t.closed, t.sticky, t.num_replies, t.last_post_id, t.last_post, f.id, f.forum_name, f.moderators, f.closed AS forum_closed, f.admmod_only, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

~118 line
list($subject, $closed, $sticky, $num_replies, $last_post_id, $last_post, $forum_id, $forum_name, $moderators, $forum_closed, $admmod_only, $is_subscribed) = $db->fetch_row($result);

+++  before $footer_style =.... add
// Create/Update topic view session
if($cur_user['last_visit'] < $last_post)
setcookie('puntopic_'.$last_post_id, time(), (time()+$pun_config['o_timeout_visit']), $cookie_path, $cookie_domain, $cookie_secure);
------------->8--------

viewforum.php
~165? line
---if (!$cookie['is_guest'] && $cur_topic['last_post'] > $cur_user['last_visit'] && $cur_topic['moved_to'] == null)
+++if (!$cookie['is_guest'] && new_topic($cur_topic['last_post_id'], $cur_topic['last_post']) && $cur_topic['moved_to'] == null)

index.php
~88? line
---if (!$cookie['is_guest'] && $cur_forum['last_post'] > $cur_user['last_visit'])
+++if (!$cookie['is_guest'] && new_topic($cur_forum['last_post_id'], $cur_forum['last_post']))


include/functions.php
+++
function new_topic($id, $last_post)
{
    global $cur_user;

    if(isset($_COOKIE['puntopic_'.$id]))
    {
        if($_COOKIE['puntopic_'.$id] < $last_post)
            return true;
    }else
    {
        if($cur_user['last_visit'] < $last_post)
            return true;
    }
    return false;
}

viewtopic.php
-----8<------
~110 ??????
if (!$cookie['is_guest'])
$result = $db->query('SELECT t.subject, t.closed, t.sticky, t.num_replies, t.last_post_id, t.last_post, f.id, f.forum_name, f.moderators, f.closed AS forum_closed, f.admmod_only, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (s.topic_id=t.id AND s.user_id='.$cur_user['id'].') WHERE t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT t.subject, t.closed, t.sticky, t.num_replies, t.last_post_id, t.last_post, f.id, f.forum_name, f.moderators, f.closed AS forum_closed, f.admmod_only, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
~118 ?????? list($subject, $closed, $sticky, $num_replies, $last_post_id, $last_post, $forum_id, $forum_name, $moderators, $forum_closed, $admmod_only, $is_subscribed) = $db->fetch_row($result);

+++  ????? $footer_style =.... ?????????
// Create/Update topic view session
if($cur_user['last_visit'] < $last_post)
setcookie('puntopic_'.$last_post_id, time(), (time()+$pun_config['o_timeout_visit']), $cookie_path, $cookie_domain, $cookie_secure);
------------->8--------

viewforum.php
~165? ??????
---if (!$cookie['is_guest'] && $cur_topic['last_post'] > $cur_user['last_visit'] && $cur_topic['moved_to'] == null)
+++if (!$cookie['is_guest'] && new_topic($cur_topic['last_post_id'], $cur_topic['last_post']) && $cur_topic['moved_to'] == null)

index.php
~88? ??????
---if (!$cookie['is_guest'] && $cur_forum['last_post'] > $cur_user['last_visit'])
+++if (!$cookie['is_guest'] && new_topic($cur_forum['last_post_id'], $cur_forum['last_post']))


include/functions.php
+++
function new_topic($id, $last_post)
{
    global $cur_user;

    if(isset($_COOKIE['puntopic_'.$id]))
    {
        if($_COOKIE['puntopic_'.$id] < $last_post)
            return true;
    }else
    {
        if($cur_user['last_visit'] < $last_post)
            return true;
    }
    return false;
}

105

(13 replies, posted in PunBB 1.2 show off)

smile))

News | Forum | School | Resource | ??? | Statistics

News | Forum | School | Resource | Our Net | Statistics

right-down there are service modules for users stats/login, list of forums, poll , our university faculties + schedule, banned list etc..
Hm... btw i wouldn't say russian is so hard to study smile

so its in deep development, but already there is smth to look at smile
http://dev.hostel.nstu.ru/pun/index.php

107

(4 replies, posted in PunBB 1.2 bug reports)

the code from the first post. but in this forum it doesn't work
hmm.. now it doesnt work in my one too....
strange... solar activity ? smile

108

(4 replies, posted in PunBB 1.2 bug reports)

this code in 1.1.5 made my forum ugly, but here it seems fixed smile
btw, i fixed this

preg_match('#\[quote=("|"|\'|)(.*)\\1\]#sU', $text, $matches);

i replaced with

preg_match('#\[quote=("|"|\'|)([0-9a-zA-z?-??-?\,\ \.]{1,30})\\1\]#sU', $text, $matches);

109

(4 replies, posted in PunBB 1.2 bug reports)

[quote]

hmmm.strange...

so would you like to run apache+php+mysql or IIS+php+mysql/mssql ?
if first -its quite simple. contact with me in ICQ, i can help you

111

(1 replies, posted in Programming)

you may see more at
http://dev.hostel.nstu.ru/pun/viewtopic.php?pid=61#61

112

(1 replies, posted in Programming)

i have a script, in separate file

function pastequote(){
    if(document.postform.req_message) document.postform.req_message.value += txt}

function copyquote(Name){
    txt=''
    if (document.getSelection) txt=document.getSelection()
    else if (document.selection) txt=document.selection.createRange().text
    txt='[quote='+Name+']'+txt+'[/quote]\n'}
    
document.onkeydown = keyDown;
window.onkeypress = keyDown;

function keyDown(DownEvents){
    var tt = document.getElementById("postform");
 if (document.all) 
 {
    var k=window.event.keyCode;

    if (window.event.srcElement.className=='post_text')
    {
        if (window.event.ctrlKey && k==13)
//        document.postform.submit(); - tried this too
    tt.submit();
    return;
    }

 }
  else
 {
  var k=DownEvents.which;

 if (DownEvents.target.className=='post_text')
  {
      if (DownEvents.ctrlKey && k==13)
     {


//    document.forms.postform.submit(); - tried this too
    tt.submit();
  return;
    }
    }
}
}

I have

 <form id="postform" name="postform" ........> ...<textarea name="post_text">....

This should submit my form if ctrl+enter pressed
So, the code above doesn't work? can anybody help me ?

it isnt working for me sad

hm. so no definite answer ?

hi all, where can i get this mod now ?

Gardener wrote:

Would you need the login and registration to work on both Mambo and PunBB, or would it be sufficient if I implemented it in Mambo?

Great idea, and it would be VERY nice, if you make it! now i'm using mambo and punbb as external forum.. though i have not enough PHP knowledge to integrate them.. sad

117

(24 replies, posted in PunBB 1.2 bug reports)

hmmm... smth is wrong with your code... it works fine with single image, but sux with series of them... i'll see it through

118

(24 replies, posted in PunBB 1.2 bug reports)

just for now , i've done such thing

$message = preg_replace('#\[img\]((f)tp://)([^\?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#si', '<img src="$1' . eregi_replace('\?.*|&.*', '', str_replace(' ', '%20', '$3')) . '" border="0" align="top" alt="< ??????? ??????????? > ">', $message);    
$message = preg_replace('#\[img\]((ht)tp://)([^\?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#si', '< <a href="$1' . eregi_replace('\?.*|&.*', '', str_replace(' ', '%20', '$3')) . '" target="_blank"><b>?????? ?? ??????? ???????????</b></a>  >', $message);    

119

(24 replies, posted in PunBB 1.2 bug reports)

pgregg wrote:

1) Add a list of _permitted_ image file types, jpg/jpeg/gif/png/etc
   then in the post submission look for [ img ] tags that don't match up.

2) Check it during the bbcode->html conversion - though I think 1 is better since it is done once rather than every time a post is viewed.

3) More specific - check the img url for login.php and deny it (assuming login.php is the only place action=out can work).

I'd rather not have a blanket ban on images sent from a .php page since I've several graph generation scripts that use such urls.

1) is not a solution. a can rename my file so evilcode.jpg
2) --||--
3)  is not a solution, because i can use not only this url, but also smth like this evilcode.js
yeah... rather hard problem, isnt ?
the only solution i see  - is to upload images to server, then check its mime-type... by it will slow down the server greatly.... + it will do MUCH traffick...

120

(24 replies, posted in PunBB 1.2 bug reports)

Chacmool wrote:

Nice one! big_smile

Evil trick!

yeah.. i know

121

(24 replies, posted in PunBB 1.2 bug reports)

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

122

(24 replies, posted in PunBB 1.2 bug reports)

check it out, i've just made a post, in test forum, topic testing

123

(24 replies, posted in PunBB 1.2 bug reports)

 like this [ img ] http://punbb.org/forums/login.php?action=out [ img ]

thx

or tell me how to make this most efficient ?