26 (edited by lhffan 2006-06-17 20:42)

Re: AJAX meets extern.php: Active topics etc.

CodeXP

I working on a webpage, where index.php (not forum index.php) will fetch posts from the forum.

And the question is how do i do that, guess i have to include ajax_extern.php into my index php, but what more is needed so my webpages startpage can fetch those posts

It must be possible in some way i guess i have to include common.php and what more must be done?

27 (edited by Pekz0r 2006-06-26 00:17)

Re: AJAX meets extern.php: Active topics etc.

I would like to see who made tha latest post too

I want a table like this:
Topic 1    <time> by <nick>
Topic 2    <time> by <nick>
Topic 3    <time> by <nick>

For example: 
test topic         19:30:45 by pekz0r

I gues it shouldn't be too hard to fix, i'm giving it a try myself

The best would probably be to edit the extern.php and not this script

28 (edited by lhffan 2006-07-21 21:20)

Re: AJAX meets extern.php: Active topics etc.

CodeXP wrote:
FxPatrice wrote:

Thanks ... It work with FF now, but I have problem with accentuated characters

Directly from extern.php I have no problem (http://forum.windows.free.fr/forum/exte … length=100) :

* panne d'enregistrement depuis la mise en veille
* récupérer tous les pilotes de son ordi
* photo
* FREE ADSL : retour à la normale le 17 mars en zone non dégroupée
* windows xp
* Freebox Haute Définition chez Free avant la rentrée 2006
* Problème synchronisation profil
* Mots chinois
* installation du SP2 impossible
* FAT 32 ou NTFS?

But with AJAX Active public topics it looks like :

* panne d'enregistrement depuis la mise en veille
* r?cup?rer tous les pilotes de son ordi
* photo
* FREE ADSL : retour ? la normale le 17 mars en zone non d?group?e
* windows xp
* Freebox Haute D?finition chez Free avant la rentr?e 2006
* Probl?me synchronisation profil
* Mots chinois
* installation du SP2 impossible
* FAT 32 ou NTFS?

I have "?" instead of "é" ... probably the same thing with other accentuated characters, I don't have  made other tests.

Can you help me ?

Thanks

That's because javascript have problems handling it without any specific headers (in this case, utf-8).

To fix, do the following:
1. Open extern.php, and find on line 245:

        $result = $db->query('SELECT t.id, t.subject 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());

Below add:

        if(isset($_GET['utf-8'])) @header("Content-type: text/html; charset=utf-8"); // Needed for accented characters w. JS/Ajax

2. Open ./include/js/ajax_extern.js, and fine on line 25:

var extern_query = 'extern.php?action=active&show=10&length=100&rnd='+rnd;

Replace with:

var extern_query = 'extern.php?action=active&show=10&length=100&utf-8=1&rnd='+rnd;

3. Save, upload and enjoy accented characters that looks correct smile

A long quote for a short question, how do do the same so my swedish languages work. I am using: iso-8859-1
I can answer my own question and it works :-)

Just replace all entries of utf-8 with iso-8859-1 and it works

29

Re: AJAX meets extern.php: Active topics etc.

Great work, CodeXP.

30

Re: AJAX meets extern.php: Active topics etc.

Great mod works fine one question related to css how can i fix the height of the box so it will work in IE/OPERA/FIREFOX ?

31 (edited by CodeXP 2006-07-22 20:51)

Re: AJAX meets extern.php: Active topics etc.

helter wrote:

Great work, CodeXP.

Thanks smile

lhffan wrote:

Great mod works fine one question related to css how can i fix the height of the box so it will work in IE/OPERA/FIREFOX ?

I'm not sure if I understand the question as it already works in all of those browsers...? If you just want to set the box to a fixed height though, just use something like:

div#rssbox { height: 250px; overflow: auto }

32

Re: AJAX meets extern.php: Active topics etc.

CodeXP, why is your website down?

33

Re: AJAX meets extern.php: Active topics etc.

hcgtv wrote:

CodeXP, why is your website down?

Well, that's kind of a long story, but the short version would be that due to some problems in real-life I had to cut all the expenses I could sad I haven't given it up entirely, but I don't know when I'll have everything sorted... Hopefully, it won't be *to* long smile

I'm still programming on my local Linux box though, so when I finally get things sorted (read: find a new job), I don't have to start all over again from scratch.

34

Re: AJAX meets extern.php: Active topics etc.

CodeXP, let us know when it's back up, you were doing some really exciting things with PunBB.

Re: AJAX meets extern.php: Active topics etc.

Hi.

I was wondering about something posted earlier in this topic. I'm making a website, and I want the site homepage to have this on it, with the active topics.

How could I do this?

36

Re: AJAX meets extern.php: Active topics etc.

Hmm this thread has the info .. you can just read through it.

Re: AJAX meets extern.php: Active topics etc.

Is it possible for this to take your forum permissions into account when showing the recent posts.  I have it working but only shows topics from the Public forums.

Re: AJAX meets extern.php: Active topics etc.

After reading all this post i can't have it working:
I get a [Active public topics: Refreshing?] under IE and FF.

any help would be much apreciated smile

Re: AJAX meets extern.php: Active topics etc.

Pekz0r wrote:

I would like to see who made tha latest post too

I want a table like this:
Topic 1    <time> by <nick>
Topic 2    <time> by <nick>
Topic 3    <time> by <nick>

For example: 
test topic         19:30:45 by pekz0r

I gues it shouldn't be too hard to fix, i'm giving it a try myself

The best would probably be to edit the extern.php and not this script

I need too

[category] Topic1 by <nick>      <time>
[category] Topic2 by <nick>      <time>
[category] Topic3 by <nick>      <time>

ex.

[Test forum] Test post by FruitCake  [20:36:35]

40

Re: AJAX meets extern.php: Active topics etc.

FruitCake wrote:
Pekz0r wrote:

I would like to see who made tha latest post too

I want a table like this:
Topic 1    <time> by <nick>
Topic 2    <time> by <nick>
Topic 3    <time> by <nick>

For example: 
test topic         19:30:45 by pekz0r

I gues it shouldn't be too hard to fix, i'm giving it a try myself

The best would probably be to edit the extern.php and not this script

I need too

[category] Topic1 by <nick>      <time>
[category] Topic2 by <nick>      <time>
[category] Topic3 by <nick>      <time>

ex.

[Test forum] Test post by FruitCake  [20:36:35]

As this mod uses the default extern.php, you'd have to mod that file to do this. I wanted this script to be as easy as possible to implement so I will most likely not add this, but it shouldn't really be that hard to do yourself smile

@buzzworkers: Try re-downloading the script (I've added a working link to the original post again). It sounds as if you got the version released before I fixed a bug with FF.

@jingoglia: I'll have to see about that, but the thing is, this would also require some modifications of the original extern.php, and I don't really want that...

Re: AJAX meets extern.php: Active topics etc.

Ahh ok, I can understand why you wouldn't want to do that.

Re: AJAX meets extern.php: Active topics etc.

Hello!

It is possible to have this example with AJAX:

List of topics with forums ID=4,22
- topic 1
- topic 2
- topic 3
- etc.

List of topics with forums ID=3,10,20
- topic 1
- topic 2
- topic 3
- etc.

List of topics with forums ID=1,12,5
- topic 1
- topic 2
- topic 3
- etc.