Navigation

Pligg Support

Live Answer Submissions
Answer Author Story Ago
I have changed a lot in the logic of the process and the coding to make it work. The way it is now is a maze. redwine Cannot Follow Members 75 days
I have a partial fix that I've pushed to Github. This will make it so that the user search and profile page follow/unfollow button links will work. There is still a problem with the unfollow links that are appearing on the user profile friend list. https://github.com/Pligg/pligg-cms/commit/c5aa84d4e6044e604cb82c01adc5f48519eb51ec Yankidank Cannot Follow Members 75 days
I will finish it today. I posted it yesterday then removed it because of a bug that still lurking around. I am almost done and changed the whole logic of it and believe me it is coming great! redwine Cannot Follow Members 75 days
I can verify that this bug exists. The follow and unfollow buttons from the user search function returns a 404 page. I will try to look into it further if Redwine hasn't posted a fix yet. Yankidank Cannot Follow Members 75 days
Yes, I am working on fixing the whole code of adding friends and simple messaging. I was supposed to finish and post the solution tonight or tomorrow morning but it seems it will take the entire tomorrow as I am finding a lot of bugs. redwine Cannot Follow Members 77 days
Thank you for bringing this flaw up, so that we fix it! :-) redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 78 days
Maan it works like a charm! You are perfect! It's great to have you here. user_4343977 Solution fro the sidebar saved stories to display only those belonging to the logged-in user 78 days
**ATTENTION YANKIDANK to uodate the Github*** In \templates\bootstrap\pligg.tpl LINE 174, we find: {include file=$the_template"/functions/bookmark.tpl"} The \templates\bootstrap\functions\bookmark.tpl includes the scripts for the add/remove bookmarks and the ajax call to update the sidebar saved stories. Open \modules\sidebar_saved\update_rightpanel.php 1- On LINE 13 (right before the query) add the following to get the main smarty variable of the logged in user: global $the_template, $main_smarty, $db; $user_logged_id = $main_smarty->get_template_vars('user_logged_id'); Replace the query: $res = "select link_id,link_title,saved_id,saved_user_id,saved_link_id from ".table_links.",".table_saved_links." WHERE saved_link_id = link_id ORDER BY saved_id DESC limit 5"; With this: $res = "select link_id,link_title,saved_id,saved_user_id,saved_link_id from ".table_links.",".table_saved_links." WHERE saved_user_id =$user_logged_id and link_id = saved_link_id ORDER BY saved_id DESC limit 5"; Save and close. NOTE I am still using $user_logged_id to be conform to what I used above in the original fix. If you used YankiDank’s Github commit, then use: global $the_template, $main_smarty, $db; $user_id = $main_smarty->get_template_vars('user_id'); $res = "select link_id,link_title,saved_id,saved_user_id,saved_link_id from ".table_links.",".table_saved_links." WHERE saved_user_id =$user_id and link_id = saved_link_id ORDER BY saved_id DESC limit 5"; Now whenever a story is added/removed, there is no need to refresh as this fix will properly update the sidebar saved stories. redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 78 days
@yankidank just write a short how to man! user_7205927 Anybody else besides me (and this site) running Pligg and WordPress together? 79 days
that's just perfect! user_4343977 Fully working implementation to display Total Story Views in the story summary. 79 days
I am glad it's working. I will take a look tomorrow and closely check the refreshing issue and possibly eliminate the need to it. redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
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. user_4343977 Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
Furthermore, here is the saved_links table with explanation. (attached) redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
And here are the snapshots redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
"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) " That's a completely wrong conclusion my friend! I just added this post as story on my development site by a new user. Then, user redwine added it. It showed in the saved stories for redwine but NOT to Giorgio who submitted the stories. To elaborate more: here is the query to get who saved what and display the stories for each user: $res = "select link_id,link_title,saved_id,saved_user_id,saved_link_id from ".table_links.",".table_saved_links." WHERE saved_user_id =$user_logged_id and link_id = saved_link_id ORDER BY saved_id DESC limit 5"; if you notice in the WHERE clause, we are specifically asking for: WHERE saved_user_id =$user_logged_id This means we are limiting the result to only those stories bookmarked by the logged in user, hence we created the samrty variable in the smartyvariables.php Now if it happens that the submitter of the story bookmarked it and another user bookmarked it as well, then yes it will show to both in the saved stories. Have you tried to refresh the page after bookmarking a story? redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
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). user_4343977 Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
The only difference between what Yankidank committed and my code here is what he changed the variable I created in the smartyvariables.php. I showed you the snapshots as a proof it is working and obvsiously YankiDank also tried it before committing it. Compare my steps above with what you have changed in your files and let me know. Go through the steps one more time and make sure they are followed correctly! redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
Correction: In the query, I mistakenly left my pligg prefix in it. So please change, In step 7 above: To this: $res = "select link_id,link_title,saved_id,saved_user_id,saved_link_id from ".table_links.",".table_saved_links." WHERE saved_user_id =$user_logged_id and link_id = saved_link_id ORDER BY saved_id DESC limit 5"; redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
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 ? user_4343977 Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days
You must have missed or incorrectly done something. Attached are 2 snapshots for 2 different users showing the save stories for each accordingly! redwine Solution fro the sidebar saved stories to display only those belonging to the logged-in user 79 days