All you [data]base are belong to us
103 2004-06-06 18:24
Re: About read/unread topics (again!) - howto? Brainstorming.. (3 replies, posted in PunBB 1.2 discussion)
And, is that too heavy for punbb?
104 2004-06-04 09:59
Topic: About read/unread topics (again!) - howto? Brainstorming.. (3 replies, posted in PunBB 1.2 discussion)
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
105 2004-05-30 21:50
Re: Word Association Thread (1,382 replies, posted in General discussion)
red chili pepper
106 2004-05-29 17:45
Re: smilies - feedback please (98 replies, posted in PunBB 1.2 discussion)
D, too
108 2004-05-23 19:22
Re: New posts in topics. (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..
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
109 2004-05-23 17:11
Re: New posts in topics. (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
110 2004-05-23 16:24
Re: New posts in topics. (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
111 2004-05-23 14:47
Re: New posts in topics. (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 2004-05-23 11:36
Re: New posts in topics. (31 replies, posted in Feature requests)
waiiiit i think I got it... it seems to work.. should be ready tonight (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.
113 2004-05-18 20:39
Re: How to... move a topic? (2 replies, posted in PunBB 1.2 troubleshooting)
thx
114 2004-05-18 19:33
Topic: How to... move a topic? (2 replies, posted in PunBB 1.2 troubleshooting)
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
115 2004-05-13 23:22
Topic: PHP in template file not interpreted (2 replies, posted in PunBB 1.2 troubleshooting)
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?
116 2004-04-25 20:59
Re: Language auto-detection (4 replies, posted in PunBB 1.2 modifications, plugins and integrations)
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.
117 2004-04-25 19:27
Topic: Different language for a profil (2 replies, posted in Feature requests)
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
Thanx, bye!
118 2004-04-24 13:44
Re: Smileys whose size is not 15*15 (6 replies, posted in PunBB 1.2 bug reports)
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?
119 2004-04-24 09:44
Re: Smileys whose size is not 15*15 (6 replies, posted in PunBB 1.2 bug reports)
Yup
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 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
Keep up the good work!
120 2004-04-24 07:20
Topic: Smileys whose size is not 15*15 (6 replies, posted in PunBB 1.2 bug reports)
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!
121 2004-04-20 22:12
Re: HowTO : merge the posts from 2 forums (12 replies, posted in PunBB 1.2 troubleshooting)
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.. 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!
122 2004-04-20 19:47
Re: HowTO : merge the posts from 2 forums (12 replies, posted in PunBB 1.2 troubleshooting)
I want to add all the posts and users from one punbb forum to one other punbb forum
123 2004-04-20 19:25
Topic: HowTO : merge the posts from 2 forums (12 replies, posted in PunBB 1.2 troubleshooting)
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!
124 2004-04-16 10:09
Re: Bug with nicknames containing a ' ; unable to post messages (13 replies, posted in PunBB 1.2 bug reports)
No, just answering any topic. I'm using v 1.1.3.
125 2004-04-16 08:15
Topic: Bug with nicknames containing a ' ; unable to post messages (13 replies, posted in PunBB 1.2 bug reports)
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