Navigation

Pligg Support

Avatar
User_4343977

Karol
1
Question: Adding Mobile Detect script and replacing link_summary.tpl on mobile
Answer: provided by user_4343977 92 days ago
- 0 + Ok, so I managed to do it in more optimal way as I wanted by copying file 'Mobile_Detect.php' to 'libs' folder and adding couple of lines to 'link.php' which is in the same folder. These are my lines 431 - 445:

function print_summary($type='full', $fetch = false, $link_summary_template = 'link_summary.tpl') {

global $current_user, $globals, $the_template, $smarty, $ranklist, $db;

require_once 'Mobile_Detect.php';

$detect = new Mobile_Detect;

$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');

if ( $deviceType == 'phone' ) {

$link_summary_template = 'link_summary_mobile.tpl';

}

// DB 09/03/08

if(!is_numeric($this->id)){return false;}

/////

include_once('../internal/Smarty.class.php');

$main_smarty = new Smarty;

$main_smarty->assign('deviceType', $deviceType);

I added script for device detection, and assigned smarty variable for validation purposes or whatever it may be useful for.

If somebody wants to check for tablet device and write a separate link_summary_tablet.tpl template you can do it by adding another conditional such as:

elseif ( $deviceType == 'tablet' ) {

$link_summary_template = 'link_summary_tablet.tpl';

}

And I added code below to link_summary.tpl and to link_summary_mobile.tpl for my validation purpose. It shows me if the type of device was properly detected:

{if $isadmin eq 'yes'}{$deviceType}{/if}

It works perfectly for me so I think I will leave it that way and hope it won't give me any troubles.

Use it if you want it.

If anybody finds a bug there please reply here.

Thanks
4
Question: Solution fro the sidebar saved stories to display only those belonging to the logged-in user
Answer: provided by user_4343977 111 days ago
- 0 + For me it (the improved code from github) still doesn't work well and here's why:

1. There are 2 users : Andrew, John.

Both of them have published stories.

Right now both of them have empty list of saved stories.

When Andrew adds to his saved stories one of stories that has been authored by John he has it in his sidebar and it's OK.

When you log in as John and look at John's saved stories sidebar it is OK until John wants to save a story. When he click to save a story then in sidebar there is the story he just saved, and a story that Andrew saved (John is an author of that story, but he didn't add it to his saved stories. This story was saved by Andrew).

When you look to "user/andrew/saved/" and "user/john/saved/ " tabs in Andrew or John profiles they have everything right - there are only stories saved by themselves. But there is a bug in sidebar.

I'm not that good in programming, but maybe there is a solution to that by using the code that shows properly saved stories from profile tabs and implement them in sidebar.

I hope you can understand my case. If something is not clear please ask me.

Could you check if my problem is isolated, or this problem is common with the commit form github?

Thanks
4
Question: Solution fro the sidebar saved stories to display only those belonging to the logged-in user
Answer: provided by user_4343977 111 days ago
- 0 + Do I get it right? If I have a Pligg 2.0.1 and I change smartyvariables.php and modulessidebar_savedtemplatessidebar_saved_index.tpl according to the changes that 'yankidank' commited on github it should work with no other changes whatsoever ?
4
Question: Solution fro the sidebar saved stories to display only those belonging to the logged-in user
Answer: provided by user_4343977 111 days ago
- 0 + So, I did a new installation of pligg from github master so I didn't change anything and it still doesn't work. The files are made exactly in a way that 'Yankidank' commited . (So they have right prefixes)

Here you have my test case which shows a bug:

1. Create admin account during new installation of pligg.

2. Submit a story from admin account.

3. Register new account : 'user1'

4.Logged in as 'user1' submit a story.

So right now you have 2 stories One made by admin and second by user1.

5. While still logged in as 'user1' please add to bookmarks only the story that was submitted by admin (admin is the author).

6. Log out and Log in as admin.

7. Add to bookmarks story that was submitted by user1.

8. Now look to sidebar your sidebar saved storied -> There are 2 stories.

Conclusion: When someone adds to bookmarks a story that is submitted by somebody else then this story shows up on both accounts in sidebar_saved. (on his account and the author of added story account)

To be exact It will appear on the user account who adds the story (authored by some other person) to his bookmarks (which is good), and on account of the author of that story in sidebar_saved (which is wrong).
4
Question: Solution fro the sidebar saved stories to display only those belonging to the logged-in user
Answer: provided by user_4343977 111 days ago
- 1 + Ok, the solution is to refresh a page, after refreshing page it works fine. :D That's true you were right and I didn't check it.

Nevertheless I have strange behaviour on the dynamic part of adding to sidebar saved. When I don't refresh page and I only click to add 1 story to bookmarks it sometimes adds more (for example it still remembers a story that i have added previously,and later removed from bookmarks - and refreshed site). After I refresh site once again it goes back to normal and shows proper stories in 'sidebar saved'. So there is a tiny flaw that could be improved. Please don't get me wrong - I am grateful that you have wrote the code - Thanks very much for your thorough explanation.
4
Question: Solution fro the sidebar saved stories to display only those belonging to the logged-in user
Answer: provided by user_4343977 110 days ago
- 1 + Maan it works like a charm!

You are perfect! It's great to have you here.
5
Question: Fully working implementation to display Total Story Views in the story summary.
Answer: provided by user_4343977 111 days ago
- 0 + that's just perfect!
3
Question: advanced search by date not working
Answer: provided by user_4343977 144 days ago
- -1 + All Radio buttons options like:

comment search, user search and tag search

don't work, which is quite sad.

Will there be some bugfixes anytime soon ?
43
Question: Sorting categories
Answer: provided by user_4343977 310 days ago
- 0 + and there's one more bug, in admin panel ->manage->categories it's impossible to select order of categories, the order is not saved, and it's quite random. It sometimes remember order of main categories, but never subcategories.
43
Question: Sorting categories
Answer: provided by user_4343977 308 days ago
- 0 + Thanks for and answer. I have 3 main categories and in one main category there are 10 subcategories. Even with reloading it's impossible to order them properly. I was thinking about setting the order numbers directly into database, but can't figure out what is the mechanism of assigning numbers of categories and subcategories. If someone know that could you tell ? When I figure it out I'll post the solution :) thanks