101

(1,382 replies, posted in General discussion)

All you [data]base are belong to us smile

102

(1,382 replies, posted in General discussion)

car

And, is that too heavy for punbb?

Ok, in order to get that (at least to me) important feature, as Rickard said he was in little trouble to implement it, I suggest a little brainstorming to implement that properly.

Jansson proposed a solution with a cookie for every read topic; i must say, I really dislike that one; imagine, when reading a big forum, with hundreds of topics... you get hundreds of cookies...

What do I suggest... In fact, my primary idea was to stock in a cookie the serialized id's of read topics. How can that work? Each time the "last visit" is updated, you have to look if there have been any new messages since last one. I currently use such a system for one of my forums , works great, but i had to add a request for each page where last visit gets updated... _but_ i think the sql request i added is certainly already done anywhere else in the script... maybe in looking in that direction...

So, how it works, quite easy, you add each time "last visit" get's updated every new topic to the cookie, and delete in viewtopic.php the id from the topic being currently read from the cookie.

Any other idea? What do you think? How could we implement that? I really like that feature... Thanks for brainstorming smile

105

(1,382 replies, posted in General discussion)

red chili pepper big_smile

106

(98 replies, posted in PunBB 1.2 discussion)

D, too smile

107

(98 replies, posted in PunBB 1.2 discussion)

smile

108

(31 replies, posted in Feature requests)

had to hack a bit to make the code works properly; might be not that clean. If you're still interested, please mail me.. smile

EDIT: please forget it, the code would be too dirty with forums containing more than one category.
EDIT2: in fact it could easily work, but I should do the sql request every time a page update the last-visited date... so.. on almost every page hmm

109

(31 replies, posted in Feature requests)

each solution has it avantages.. you choose to use more cookies, i choose to use one sql  query more... I'll look if it's possible do use less cpu.

Bye wink

110

(31 replies, posted in Feature requests)

mmh... not sure.. you are calling a function for each topic, i'm doing one sql query... moreover, it might be possible to do the same without that query, using a query that is already done later... and i'm using only one cookie big_smile

111

(31 replies, posted in Feature requests)

mmmh, in fact alll what I need are the newest topics... i'll try adding a where clause.
NB: is it possible to discuss with you via irc, icq, other? might be easier.
+


$result = $db->query('SELECT id , last_post FROM '.$db->prefix.'topics where last_post>'.$cur_user['last_visit']) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

while ($row = $db->fetch_row($result))
    if (!in_array($row[0], $unreadtopics))
        array_push($unreadtopics, $row[0]);


better so?

112

(31 replies, posted in Feature requests)

waiiiit i think I got it... it seems to work..  should be ready tonight smile (with only one small cookie, and one db query) Ok, here is a beginning; shows unread threads, but not unread forums, is not that perfect but seems to work:

add this to viewtopic.php, at the beginning:

if ($_COOKIE['unreadtopicscookie'] != '') {
    $unreadtopics = array();
    $unreadtopics = unserialize(stripslashes($_COOKIE['unreadtopicscookie']));
    unset($unreadtopics[array_search($_GET['id'], $unreadtopics)]);
    setcookie('unreadtopicscookie', serialize($unreadtopics), time()+60*60*24*335); /* One year cookie*/
}

and add this to viewforum.php (below the two includes):

if ($_COOKIE['unreadtopicscookie'] != '') {
    $unreadtopics = array();
    $unreadtopics = unserialize(stripslashes($_COOKIE['unreadtopicscookie']));

    $result = $db->query('SELECT id , last_post FROM '.$db->prefix.'topics') or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

    while ($row = $db->fetch_row($result))
    if ($row[1]>$cur_user['last_visit'] && !in_array($row[0], $unreadtopics))
        array_push($unreadtopics, $row[0]);

    setcookie('unreadtopicscookie', serialize($unreadtopics), time()+60*60*24*335); /* One year cookie*/
} else {
    $unreadtopics = array();
}       

And finally in viewforum.php, where the test if the topic is read or not (should be approximatively at line 165), replace the condition with:
if (!$cookie['is_guest'] && in_array($cur_topic['id'], $unreadtopics) && $cur_topic['moved_to'] == null)

I'll try to cleanup all that stuff, and make it work in the listing of the forums, too... help would be much appreciated.
++

I forgot, turn Visit timeout to 0 in the admin panel.
BTW, in misc.php, add :
setcookie('unreadtopicscookie', '', time()+60*60*24*335);
in the else if ($action == 'markread') statement.

thx smile

Hi,

  i think punbb offers that feature, but i looked everywhere in the admin panel, read the faq and so on, but didnot find anything... how can i move a topic from a forum to another? sorry if that has already been answered somewhere else hmm

Hi, I'm trying to include php in the template file main.tpl, and it seems that it does not get interpreted; i got the php script in the resulting html file. This might be due to the name of the template file, main.tpl; a solution would be to rename the template fiel main.tpl.php... what do you think?

function get_pref_language_array($str_http_languages)
{
  $langs = explode(',',$str_http_languages);
  $qcandidat = 0;
  $nblang = count($langs);

  for ($i=0; $i<$nblang; $i++)
  {
    for ($j=0; $j<count($langs); $j++) {
      $lang = trim($langs[$j]); // Supprime les espaces avant et après $lang
      // Lang est de la forme langue;q=valeur
     
      if (!strstr($lang, ';') && $qcandidat != 1) {
        // Si la chaine ne contient pas de valeur de préférence q
        $candidat = $lang;
        $qcandidat = 1;
        $indicecandidat = $j;
      }
      else {
        // On récupère l'indice q
        $q = ereg_replace('.*;q=(.*)', '\\1', $lang);

        if ($q > $qcandidat) {
          $candidat = ereg_replace('(.*);.*', '\\1', $lang); ;
          $qcandidat = $q;
          $indicecandidat = $j;     
        }
      }
    }
   
    $resultat[$i] = $candidat;

    $qcandidat=0;
    // On supprime la valeur du tableau
    unset($langs[$indicecandidat]);   
    $langs = array_values($langs);
  }
  return $resultat;
}

I wrote that function once to detect the language, it's a bit more rfc compliant in that if I anderstand the above code correctly, you assume the first language given is the prefered one, wich is in most case true, but it's not defined that precisely in the RFC.
This function takes  $_SERVER['HTTP_ACCEPT_LANGUAGE'] as parameter, and returns an array containg the languages, beginning with the prefered one, and sorted by preference.

Hope this helps.

Hi,

  i'm using punbb for a french/german forum; as i have french and german users, I wanted to know if it would be possible that each registered user choose his prefered language himselft in his profile.. so, german people could use the forum in german, and the others in french smile

Thanx, bye!

Yup, no, i don't think it's a good thing to use getimagesize... Imagine, with a lot of smileys, how heavy that would be... in my case, i juste removed the attriutes... Maybe, just adding to the faq "if you want to use smileys whose size is not 15*15, please remove the attributes with and hight there and there" would be enough.. no?

Yup smile
The best way would be to determine the size of the smileys with a library such as GD, but that's a bit overkill I think lol big_smile As the smileys aren't so big, removing the prédefined size of the smileys shouldn't be that painful.
That was just my advice smile

Keep up the good work!

Hi,

  in help.php and include/parse.php, punbb force the size of the smileys to 15*15... I'm not sure that it's a good idea, as you might want to use smileys that might be bigger. Removing the width and height attributes of  the img tags solves the problem.

Bye!

Yup, in fact I had a look at the database, just to see how it looked like... and guessed there could be many,, many problems in doing that.. big_smile it's not that important, in fact there were only 100 posts; I was just wondering if it was possible or not.
Thanx for your answer, bye!

I want to add all the posts and users from one punbb forum to one other punbb forum smile

Hi..

  I want to merge the posts from 2 forums; in fact, i have two forums, with different users and topics; i want to add all the users and messages from the first forum into the 2nd... is this possible?

Thanx for help, bye!

No, just answering any topic. I'm using v 1.1.3.

When logged under a nickname containing à ', it is impossible to post any message. I get the error: " Erreur. Le lien que vous avez suivi est incorrect ou périmé." after submitting it. (sorry, my forum is configured in french). It means something like: "Error, the link is incorrect".

Removing the ' from the nickname allows the user to post message again.
Thx for your help, keep up the good work, punbb is a great forum smile