Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 ... 4 5 [6]

Author Topic: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users  (Read 38774 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #75 on: March 25, 2008, 02:08:40 pm »


Keyrock i have question and i am sure you will solve it or answer my question.
i want to use TinyMCE editor with your MEMU mode, i was did it but something was missed.
how can i delete your editor and replace TinyMCE, can u help me sir

thank you - Azad

In your snewsMU.php file... within the // ARTICLES FORM function... locate the following block of code and either comment it out or remove it altogether. If you remove it altogether... make a backup copy of the file before you remove it so you still have the original file for future reference. This block of code generates all of the icon-based editor buttons under the default textarea:

Code: [Select]
<?php

# EDITOR FUNCTIONS (icon images) - admin panel mod ----------------------------- replaces default editor function buttons
echo '<p>';
# Bold text
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_bold.gif" alt="'.l('button_bold').'" name="strong" value="strong" onclick="tag(\'strong\'); return false;" />';
#Italic text
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_italic.gif" alt="'.l('button_italic').'" name="em" value="em" onclick="tag(\'em\'); return false;" />';
# Strike-through text
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_strikethrough.gif" alt="'.l('button_strike').'" name="del" value="del" onclick="tag(\'del\'); return false;" />';
# quad-left text, paragraph
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_left.gif" alt="'.l('button_textleft').'" name="p" value="p" onclick="tag(\'p\'); return false;" />';
# Centered text, paragraph
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_center.gif" alt="'.l('button_textcenter').'" name="centered" value="centered" onclick="tag(\'centered\'); return false;" />';
# Quad Right Text
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_right.gif" alt="'.l('button_textright').'" name="right" value="right" onclick="tag(\'right\'); return false;" />';
# Justified text, paragraph
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/text_justify.gif" alt="'.l('button_justify').'" name="justify" value="justify" onclick="tag(\'justify\'); return false;" />';
# Position image right, with text-wrap
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/image-right.gif" alt="'.l('button_imageright').'" name="imageright" value="imageright" onclick="tag(\'imageright\'); return false;" />';
# Position image right, with text-wrap
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/image-left.gif" alt="'.l('button_imageleft').'" name="imageleft" value="imageleft" onclick="tag(\'imageleft\'); return false;" />';
# Return, new line - <br />
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/return.gif" alt="'.l('button_return').'" name="br" value="br" onclick="tag(\'br\'); return false;" />';
# [Break] article text
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/break.gif" alt="'.l('button_break').'" name="break" value="break" onclick="tag(\'break\'); return false;" />';
# Insert URL link
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/link.gif" alt="'.l('button_link').'" name="link" value="link" onclick="tag(\'link\'); return false;" />';
# Include File file-path
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/include.gif" alt="'.l('button_include').'" name="include" value="include" onclick="tag(\'include\'); return false;" />';
# Insert SEF link to Hidden Article content: (Mod Philmoz insertHA), disabled, not used in this package
// echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/hidden_art.gif" alt="'.l('button_hiddenarticle').'" name="insert" value="insert" onclick="tag(\'insert\'); return false;" />';

# Insert Event Block (keyrocks)
echo '<input type="image" src="'.db(website).''.gl(sub_dir).'sn_icons/block.gif" alt="'.l('button_block1').'" name="eventblock" value="eventblock" onclick="tag(\'eventblock\'); return false;" />';
# ------------- end of new editor function buttons ----------------------------*/
echo '</p>';

?>


Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

azad

  • Newbie
  • *
  • Karma: 0
  • Posts: 21
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #76 on: March 26, 2008, 06:47:09 am »

for jlhaslip

Hi jlhaslip

thanks jlhaslip my problem was solved.
thanks again maybe next time i will learn more from you  and other friends.

for Keyrock

thanks a lot keyrock, i am just trying now, when i will done reply u

i am too happy to join this forum and use sNewsCMS my first and great CMS

thanks
Logged

azad

  • Newbie
  • *
  • Karma: 0
  • Posts: 21
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #77 on: March 27, 2008, 01:27:00 pm »


Keyrock i have question and i am sure you will solve it or answer my question.
i want to use TinyMCE editor with your MEMU mode, i was did it but something was missed.
how can i delete your editor and replace TinyMCE, can u help me sir

thank you - Azad

Hi Keyrock

in you sNewsMEMU 1.6  when you submit a article their is a option "This article can be viewed only by users when logged in."

Example:

i have a site where you and me are user and when i login or not your data invisible to me but when you login it will visible for you and same for me when i login than display my content, you can't see my content and articles

please quick reply

thanks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #78 on: March 27, 2008, 01:52:59 pm »

Hi Keyrock
in you sNewsMEMU 1.6  when you submit a article their is a option "This article can be viewed only by users when logged in."

Example:
i have a site where you and me are user and when i login or not your data invisible to me but when you login it will visible for you and same for me when i login than display my content, you can't see my content and articles

please quick reply
thanks

I don't understand what your point is. Here is source of this mod. Have a read- through there and see if you can find what you are looking for,

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

azad

  • Newbie
  • *
  • Karma: 0
  • Posts: 21
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #79 on: March 27, 2008, 02:00:39 pm »

I don't understand what your point is. Here is source of this mod. Have a read- through there and see if you can find what you are looking for,

thanks for quick reply Keyrock

sorry my English is not well

my point is:

in one website only two users but one user can't view other user data

example if i submit article, nobody can view else me

thanks
Logged

Jessica Michelle

  • Newbie
  • *
  • Karma: 1
  • Posts: 21
  • DivaDivine
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #80 on: April 07, 2008, 02:41:03 am »

Hi KeyRocks, me again... ::)

I just came across this SNews16 MEMU enhancement of yours! Cool, thanx for this. As you know, i have been using the MUAM package by Rui Mendes and i came across the problem i described to you regarding extra contents 2 and 3. I am sorry to have bothered you in the first place as i now realize you had very little to do with the MUAM package in the first place. My apologies. I guess you thought i was talking about MEMU right? oh this can be so confusing, MUAM, MEMU, MEMO, MAMA, MUMY, gosh!!! Anyways, i am going to give your package a spin so will get to work right away. Thanks for your much appreciated efforts!  :-*
Logged
Slutty alright but pretty and with BRAINS

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #81 on: April 07, 2008, 06:44:54 am »

Jessica i love you :)
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

sibas

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 451
    • www.simply4all.net
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #82 on: June 05, 2008, 02:49:03 pm »

I install again memu after long time  ;)
I look in category_lists.php which have

Code: [Select]
if (!$_SESSION[db('website').'Logged_In'] == token()){jsuser();}
this generate in every  "Cat List" the script function toggle(div) and makes html looks ugly
why is the need for this, I mean if you make it like the following

Code: [Select]
if (!$_SESSION[db('website').'Logged_In'] == token());
still working and you donít have inside html the repeat of JavaScript
or I miss something?
Logged

zippoxer

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #83 on: March 07, 2009, 12:41:41 pm »

Wowww it is a really great MOD!!!
I just need to translate it to hebrew.

THANKS MAN!!
Logged

Lt Newsie

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #84 on: January 14, 2010, 11:36:46 pm »

First, a thank you again to Keyrocks for this awesome package. Everything works great, except the download right now contains a few problems with editing comments. As admin, I had an "Edit" link next to a person's comment, but the page it went to was blank. Here's the fix:

in function edit_comment() on line 1898:
Code: [Select]
if (get_identity($_SESSION['id'],edit_comments) == 'YES'){it should be:
Code: [Select]
if (get_identity($_SESSION['id'], 'level') == '1' || get_identity($_SESSION['id'],edit_comments) == 'YES'){
Once that was fixed, I could edit comments, but the link back to the article was bad. The culprit is on line 2168:
Code: [Select]
$link = find_cat_sef($categoryid).'/'.retrieve('seftitle', 'articles', 'id', $articleid);It should instead be:
Code: [Select]
$link = find_cat_sef($articleid).'/'.retrieve('seftitle', 'articles', 'id', $articleid);
Those were actual bugs that were easily fixed; but I also wanted to see if I could allow the commenter to edit his or her comments. To do that, you have to go back to the edit_comment function on line 1898.

First, move the variables above the if statement:
Code: [Select]
$commentid = $_GET['commentid'];
$query = mysql_query("SELECT * FROM ".db('prefix')."comments WHERE id='$commentid'");
$r = mysql_fetch_array($query);
$articleTITLE = retrieve(title, articles, id, $r['articleid']);
if (get_identity($_SESSION['id'], 'level') == '1' || get_identity($_SESSION['id'],edit_comments) == 'YES'){

Now add a new variable (after the mysql_fetch_array):
Code: [Select]
$athrid = stripslashes(substr($r['author_id'], -2));
And then modify the if statement:
Code: [Select]
if ($_SESSION['id'] == $athrid || get_identity($_SESSION['id'], 'level') == '1' || get_identity($_SESSION['id'],edit_comments) == 'YES'){
We don't want the average user to approve/not approve messages on line 1915:
Code: [Select]
echo html_input('checkbox', 'approved', 'a', '', l('approved'), '', '', '', '', $r['approved'] == 'True' ? 'ok' : '', '', '', '', '', '');so change it to:
Code: [Select]
if (get_identity($_SESSION['id'], 'level') == '1') { echo html_input('checkbox', 'approved', 'a', '', l('approved'), '', '', '', '', $r['approved'] == 'True' ? 'ok' : '', '', '', '', '', ''); }
else { echo html_input('hidden', 'approved', 'a', 'on', '', '', '', '', '', '', '', '', '', '', ''); }

That last edit with the checkbox is just b/c I wanted only the administrator to approve/not approve edits. You could easily change that if statement to encompass other levels (like a SuperEditor), just add:
Code: [Select]
if (get_identity($_SESSION['id'], 'level') == '1' || get_identity($_SESSION['id'], 'level') == '2' ) {
In the future, it'd probably be better if the ability to allow users to edit comments were moved to the admin panel in some way (haven't really looked at how that would work yet, just a suggestion). For now, this'll let you open up editing comments, if you so choose to. Hope it helps, and thanks to the sNews community.
Logged
"Message coming in Captain." --Lt. Uhura, Star Trek
"I repeated the computer, Fred." --Gwen DeMarco (aka Lt. Madison), Galaxy Quest

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #85 on: January 15, 2010, 07:34:35 pm »

First, a thank you again to Keyrocks for this awesome package. Everything works great, except the download right now contains a few problems with editing comments. As admin, I had an "Edit" link next to a person's comment, but the page it went to was blank. Here's the fix:

@ Lt Newsie... thanks for posting your 'fix' and additional mods.

As noted earlier (by P.M.)... I tested all of the projects I have based on Bakercad's MU 1.6.3 release, including the default release itself.
I have not been able to replicate the 'bug' you experienced.

You did not note in your post where you experienced the blank page after clicking the EDIT link on a comment.
There are two places where we have comment EDIT links - in the Admin's "Waiting for Approval" list and with the comments already approved and visible.
All of the links work fine in both locations for me.

Before applying your fix, did you check (as Admin) in the User List -> User's Profile -> User Privilege Level panel (for the User experiencing the bug) to see if the "Approve Comments" permission was checked (set to 'YES' in the db users table)? If it is not checked (for any Admin, Super Editor or Editor) then the User will always get a blank in function center() when clicking a comment EDIT link.

I'm thinking of a better improvement here...
If Admin, Super Editor or Editor's "Approve Comments" permission is disabled:
     a)  hide the EDIT - DELETE links on approved, visible comments altogether,
     b)  hide the "Comments Waiting for Approval" admin panel from view.

We'd just need to apply the permission check around the link strings where generated in their respective functions.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Lt Newsie

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #86 on: January 15, 2010, 08:28:01 pm »

You did not note in your post where you experienced the blank page after clicking the EDIT link on a comment.

@Keyrocks: Ah, sorry about that. The problem I encountered was with comments already approved and visible beneath an article: clicking on the edit link there just brought me to a blank page. As for the issue about recreation, you have me there, since I didn't realize that approving comments was set in the user privelege area. I do remember checking the mysql users table and seeing that admin was set to 'NO' for approve comments. Obviously I should have checked a little farther in the interface before assuming I should go straight to code (test, test, and test again, as they say). And I certainly agree with your improvement, best to hide the link from the get-go.

I suppose I was coming at the the problem from a different perspective, since I had assumed an admin would have all privileges by default (teach me not to assume things). Not to be ornery, but is there a particular reason an admin shouldn't be able to edit comments? I suppose if you had more than one admin, that might be the case, but isn't there normally just one? And wouldn't that other admin just be able to set his priveleges back? That's all hypothetical speculation, though, and probably getting off-topic for this thread.
Logged
"Message coming in Captain." --Lt. Uhura, Star Trek
"I repeated the computer, Fred." --Gwen DeMarco (aka Lt. Madison), Galaxy Quest

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [Package] sNews 1.6 MEMU = Modular, Enhanced & Multiple Users
« Reply #87 on: January 16, 2010, 02:09:14 am »

You did not note in your post where you experienced the blank page after clicking the EDIT link on a comment.

@Keyrocks: Ah, sorry about that.
Not to be ornery, but is there a particular reason an admin shouldn't be able to edit comments? I suppose if you had more than one admin, that might be the case, but isn't there normally just one? And wouldn't that other admin just be able to set his priveleges back? That's all hypothetical speculation, though, and probably getting off-topic for this thread.

No need to apologise, and you're not being ornery at all.
Just to be sure, I checked the default MU 1.6.3 snewsMU.php file and looked at function profile() again.
If you have a copy running on your localhost (own machine), have a look at this section in function profile() - in a default snewsMU.php file.

Code: [Select]
<?php

/************************************************************************
2008-1-11
FIX: by bakercad
Problem: Admin wasn't able to set this information, Super Editor and Editor shoudn't have this option.
Only Admin with Site Owner privileges should have this access
Offening code: if ($level == '2' || $level == '3'){
************************************************************************/
if ($level == '1' && get_identity($_SESSION['id'], 'site_owner') == 'YES'){
// END FIX
echo html_input('checkbox''edit_comments''edcom''YES'l('mu_edit_comments'), ''''''''$edit_comments'''''''''''');
echo html_input('checkbox''permit_upload''pfiles''YES'l('mu_permit_upload'), ''''''''$permit_upload'''''''''');

?>


Earlier versions of Backercad's MU package (pre 1.6.3) were checking permissions with 2 conditions existing if ($level == '2' || $level == '3') { which allowed either Super Editors (level 2) - OR - Editors (level 3) to view and change the check-boxes for "Edit Comments" and "Upload Files".
I still had the 'old' version in a couple of my localhost testing projects.
And, as we can see (by Bob's notes above) he replaced that string (in 1.6.3) with if ($level == '1' && get_identity($_SESSION['id'], 'site_owner') == 'YES') { which makes those options only visible when TWO conditions exist... if the logged-in user is level 1 (admin) AND the user is also the site owner.

The Admin can (normally) check or un-check the "Site Owner" status for any User when editing User Privileges. So, if there were other Admin accounts (level 1) the "Site Owner" status could be un-checked for them and, if so, they would not see any of the privilege options contained within that permissions check spot.

Then, below the above section, you'll see that Bob made 2 more fixes:

Code: [Select]
<?php

/************************************************************************
2008-1-11
FIX: by bakercad
Problem: $_GET['id'] is incorrect code
Offening code: if (get_identity($_GET['id'], 'site_owner') == 'YES'){
************************************************************************/
if (get_identity($_SESSION['id'], 'site_owner') == 'YES'){
// END FIX
echo html_input('checkbox''site_owner''sowner''YES'l('mu_site_owner'), ''''''''$site_owner'''''''''');
}

/************************************************************************
2008-1-11
FIX: by bakercad
Problem: no code to set in site_owner field in db table
Offening code: N/A
************************************************************************/
else {
echo html_input('hidden''site_owner''siteown''NO''''''''''''''''''''''');
}
// END FIX

?>


In the first part the logged-in User's identity is checked to see if his "Site Owner" status is set to 'YES' and, if so, makes the "Site Owner" check-box available. If not, then the second part ensures the "Site Owner" status remains set to 'NO', which... in the case of another Admin account, means those other Admins without "Site Owner" status would not see that particular option.

I'm thinking of another change... in this function now... and that would be to move the if ($level == '1' && get_identity($_SESSION['id'], 'site_owner') == 'YES') { string further up in the function, before the Level options drop-down, so that that drop-down would not be visible and editable by Super Editors and Editors. As it is now, they could change their own "Site Owner" status.

This just goes to show that there is always room for improvements.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: 1 ... 4 5 [6]