[RC2] phpBB Ajax Like

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
Ludovic B
Registered User
Posts: 14
Joined: Wed Jan 29, 2014 1:06 am

Re: [RC2] phpBB Ajax Like

Post by Ludovic B » Wed Jan 29, 2014 1:21 am

Hello @emosbat :)

I thought I did all right but...

no LIKE button.

http://www.zebrolution.net/pistes-pour- ... s-t20.html

What's wrong ?

EDIT : sorry the forum had a problem today, I solved it. Can you check the url ?

User avatar
emosbat
Registered User
Posts: 564
Joined: Sat Jan 28, 2012 1:25 pm

Re: [RC2] phpBB Ajax Like

Post by emosbat » Fri Jan 31, 2014 2:18 pm

please read first post specially detail about installing in other languages and themes

Ludovic B
Registered User
Posts: 14
Joined: Wed Jan 29, 2014 1:06 am

Re: [RC2] phpBB Ajax Like

Post by Ludovic B » Fri Jan 31, 2014 2:33 pm

Thanks for being there :)

You mean, what you said here :
- if you use language rather than english, copy all language files to folder of your language (if translate not exist).
?

By "all language files", do you mean :
* the language files of phpBB
* or the language files of your MOD ?

By "folder of your language", do you mean :
* the folder of phpBB ?
* or the folder of the theme ?

Sorry I'm new in phpBB and installing MODs.

EDIT :
* I copied your contrib\fr\root\language\fr\ to my language/fr/mods, and refreshed the theme and template, and emptied the cache
* I also installed the CHANGE (--> FR) to your MOD
, but it still does not work.
The french translation is not taken into account.
An idea why ?

Ludovic B
Registered User
Posts: 14
Joined: Wed Jan 29, 2014 1:06 am

Re: [RC2] phpBB Ajax Like

Post by Ludovic B » Wed Feb 05, 2014 2:21 am

Edit : Solved !

Rob-Rah
Registered User
Posts: 36
Joined: Tue Sep 07, 2004 9:53 pm

Re: [RC2] phpBB Ajax Like

Post by Rob-Rah » Sun Feb 09, 2014 10:23 am

I have worked out why this mod was not working for me on some pages....

I have the phpbb gallery installed (heavily hacked by me!). This sits in a new set of folders on the server like this, but all the following will apply to any installation where there are accessible php pages which are not located in the root installation folder itself.

[root]/gallery/files.php

The "like" mod looks for urls by using the built-in $phpbb_root_path definition. We would expect this root path to be equal to "[root]/"

However....... *unfortunately* the real phpbb_root_path is not defined in a standard phpbb installation (see here: https://area51.phpbb.com/phpBB/viewtopi ... 99&t=42239).

So the expression that phpbb pages encounter here will always revert to setting the root path as "./" and not as"[root]/"

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';

The gallery mod is written to cope with this, but the Ajaxlike mod doesn't know about this issue. So the mod will use ./ as the root path, which in the context of [root]/gallery/files.php is incorrect (it will use [root]/gallery/).

This is a problem because the ajaxlike mod uses the overall header file to display the rcenet likes notifications. All is fine when viewing topics and so on because their php files sit in the root folder. The problem arises when viewing a page which is not in the root folder but nonetheless includes the overall header for the forum, and which therefore tries to use the ajaxlike functions for displaying notifications of likes.

In short...... the ajaxlike mod cannot reliably use the inbuilt phpbb definition of $phpbb_root_path where you are using subfolders for pages which include the main overall_header template.

It doesn't work to define the phpbb root path directly in constants.php because this file is parsed only after it's actually needed by the phpbb pages (how silly is that?).

So the ajaxlike mod needs to be changed to define the root path itself in each instance it uses it within the overall_header template. Which is annoying. The links in question are avatar, userid in memberlist.php and the post link in viewtopi.php. I have just gone into the relevant bits and hard-coded my own root path (http://www.ukorchidforum.com) into them to fix it. Not ideal, but anyway. The file needing changes was /includes/functions_ajaxlike.php

This bit fixes avatar display:

Code: Select all

function get_avatar_ajaxlike($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
{
        global $user, $config, $phpbb_root_path, $phpEx;

        // Added the next line to redefine the root path
        $phpbb_root_path = 'http://www.ukorchidforum.com/';
Weirdly, fixing the avatar bit above also fixed the profile link to memberlist.php. The next one fixes post-links within the notifications, but not for the first notification in the list:

Code: Select all

function get_notifications()
{

	global $db, $user, $config, $phpbb_root_path, $phpEx;

        // Added the next line to redefine the root path
	$phpbb_root_path = 'http://www.ukorchidforum.com/';
This fixes all entries except the first one in the listbox. To fix the first one I eventually worked out I needed to add in that hardcoded $phpbb_root_path definition in the function get_liked_list() just before both of the two lines starting with this:

$textp = append_sid(

If I put it at the start of that function, the function hangs. Not sure why. It was easier not to try to find out ;)

If someone were using other viewable php pages which used any ajaxlike functions called from those pages, those functions would also need this adjustment. Fortunately that doesn't apply to me here.

I'll try and fathom my other problems out as time goes on.

Thanks!

eric90066
Registered User
Posts: 31
Joined: Mon Aug 08, 2011 6:28 pm

Re: [RC2] phpBB Ajax Like

Post by eric90066 » Tue Feb 11, 2014 9:32 pm

Great mod. Can't wait to try it out.

senatorman
Registered User
Posts: 47
Joined: Sat Mar 12, 2011 3:54 pm

Re: [RC2] phpBB Ajax Like

Post by senatorman » Tue Feb 11, 2014 9:41 pm

Sure a great mod,

When can we expected the first release of this mod?

User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [RC2] phpBB Ajax Like

Post by Jessica » Tue Feb 11, 2014 10:23 pm

senatorman wrote:Sure a great mod,

When can we expected the first release of this mod?
It's already been released...download is in the first post.....
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein

senatorman
Registered User
Posts: 47
Joined: Sat Mar 12, 2011 3:54 pm

Re: [RC2] phpBB Ajax Like

Post by senatorman » Sat Feb 15, 2014 1:29 pm

Jessica wrote:
senatorman wrote:Sure a great mod,

When can we expect the first release of this mod?
It's already been released...download is in the first post.....
I mean the release of the first validated version.

The first 1.1.0 had too many bugs, so it is not operative for me. Iám hope whe can expect a good working version soon.

senatorman
Registered User
Posts: 47
Joined: Sat Mar 12, 2011 3:54 pm

Re: [RC2] phpBB Ajax Like

Post by senatorman » Sun Feb 16, 2014 9:40 pm

My forum has two theme's prosilver and subsilver2

When I installed this mod in prosilver it works correctly,
i do al the changes for subsilver2 as write in the installmanual for subsilver2.
And after i checked it serveral times.

In subsilver there i have a problem with the script. and the result is asfollow,

When i click on "like" in a topic, nothing happend, it is not changing in "unlike",
and when i click the link in the header to see all the likes i recieved, there is nothing happens.

The problem is in the script, and maybe the is a conflict between an another script, but i can't find it.

I download and use Firebug for Google Chome, but i don't know how this works, so i have still my problem.

Can anyone help me.

my forum is http://www.auto-forum.nl
Ajax Like mod is only enabled in this forum.
http://www.auto-forum.nl/viewforum.php?f=68

senatorman
Registered User
Posts: 47
Joined: Sat Mar 12, 2011 3:54 pm

Re: [RC2] phpBB Ajax Like

Post by senatorman » Mon Feb 24, 2014 11:35 am

Nobody knows?

Rob-Rah
Registered User
Posts: 36
Joined: Tue Sep 07, 2004 9:53 pm

Re: [RC2] phpBB Ajax Like

Post by Rob-Rah » Tue Feb 25, 2014 6:43 pm

I looked at your forum.... but you don't make it clear. Is the page guests see in subsilver or prosilver? It seems to be called skymilesread. Where is the problem showing?

senatorman
Registered User
Posts: 47
Joined: Sat Mar 12, 2011 3:54 pm

Re: [RC2] phpBB Ajax Like

Post by senatorman » Tue Feb 25, 2014 8:24 pm

Rob-Rah wrote:I looked at your forum.... but you don't make it clear. Is the page guests see in subsilver or prosilver? It seems to be called skymilesread. Where is the problem showing?
I use indeed theme Skymilesread, and this is a subsilver based theme.
My forum has also installed the original prosilver and subsilver.

In prosilver everything works fine, but in subsilver & skymilesread there is a problem.

I have acivated this mod only in a few subforums and for example you can see working this mod in this topic http://www.auto-forum.nl/viewtopic.php?f=68&t=463

There is an testaccount:

username:test
password:test

The problem is that the ajax-script is not working, so
-When you like, the like where not accepted (there is nothing changed).
-There is no popup when you click on to see al the likes
-In the header the link to see your received likes is not working.

i hope you see my problem.
i can make printscreens,

Rob-Rah
Registered User
Posts: 36
Joined: Tue Sep 07, 2004 9:53 pm

Re: [RC2] phpBB Ajax Like

Post by Rob-Rah » Tue Feb 25, 2014 8:41 pm

I don't mind having a look... I've hacked apart this mod quite a bit for my own forum now. Just to begin, can you send me the basic subsilver overall header file you are using with the mod in it, send it via the pm system here, and then I'll reply with anything I can think of here.

User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

Re: [RC2] phpBB Ajax Like

Post by muggins » Wed Feb 26, 2014 2:50 am

Image

Does this call in the body have anything to do with it, or am I stupid at this hour? :oops:
Muggins

Locked

Return to “[3.0.x] MODs in Development”