Userpanel CP

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
ff123
Posts: 172
Joined: Thu 9. Jun 2005, 20:03
Location: The Netherlands
Contact:

Post by ff123 »

This is the complete install.txt
///// Please take one second to read this header :)
/////
///// http://www.enym.com
///// Konstantin Schultes
/////
///// LOGIN-LOGOUT PANEL CONTENT-PART
///// ===============================
/////
///// Successfully tested with fresh install of 1.2.6
/////
///// Special thanx to the whole community and Oliver Georgi :)
/////
///// Login-Logout Panel lets you set up and customize a panel that fits most needs
///// everything can be changed via admin.
/////
/////
///// Installation time: ~ 5 min
///// Level: "easy"
/////
///// Languages included: GERMAN & ENGLISH
///// If you like please translate appropriate file in include/inc_lang/add to lang_inc.txt
///// and send it to info@enym.com
/////
///// Any help is much appreciated :)
/////
///// Have fun and don't forget phpwcms is great ;)
/////
///// Thanks:
///// special thanks to julius for the netherlands - translation
///// thanx to markoehl for the basis and pwmod
/////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
///// USE VTS ONLY IF YOU DO HAVE IT INSTALLED! <---------------------------------!!!!!!!!!!!!!!!
/////////////////////////////////////////////////
/////////////////////////////////////////////////


1. Files: Easy Installation (just copy include folder)
------------------------------------------------------

Put all files in the appropriate folders (there are none to overwrite)
Add the language texts into the language files (see mentioned files \include\inc_lang\backend\de or en\add to lang.inc.txt)



/////
/////
/////
/////
/////
/////



2. Some minor code changes:
---------------------------

add

to include/inc_lib/article.contenttype.inc.php

203 => $BL['be_ctype_login']

Or alternitavely (its the same):

replace this:
24 => $BL['be_ctype_alias']

with that:
24 => $BL['be_ctype_alias'],
203 => $BL['be_ctype_login']

(just to make you mind that comma - no comma in the last line!!)


/////
/////


Replace in index.php

(search for "visible_mode")

// define VISIBLE_MODE
// 0 = frontend (all) mode
// 1 = article user mode
// 2 = admin user mode
if(empty($_SESSION["wcs_user_id"])) {
define('VISIBLE_MODE', 0);
} else {
define('VISIBLE_MODE', $_SESSION["wcs_user_admin"] != 1 ? 0 : 2);
}

WITH

// define VISIBLE_MODE
// 0 = frontend (all) mode
// 1 = article user mode
// 2 = admin user mode
if(empty($_SESSION["wcs_user_id"])) {
define('VISIBLE_MODE', 0);
} else if($_SESSION["wcs_user_fe"] == 0) {
define('VISIBLE_MODE', 2);
} else {
define('VISIBLE_MODE', $_SESSION["wcs_user_admin"] != 1 ? 0 : 2);
}



/////
/////






finished

------------------------------------------------------
THE REST IS OPTIONAL! BUT WORTH BEING IMPLEMENTED TOO!
------------------------------------------------------












Change logout-target page (target after logout from admin, or frontend)

In phpwcms.php edit the following:

replace this:

//ENYM.com login-logout-panel
case "logout": //Logout
mysql_query("UPDATE ".DB_PREPEND."phpwcms_userlog SET logged_change=".time().", logged_in=0 WHERE logged_user='".$_SESSION["wcs_user"]."' AND logged_in=1;");
session_destroy();
header("Location: ".PHPWCMS_URL."login.php");
exit();
break;
//ENYM.com login-logout-panel

with that:

//ENYM.com login-logout-panel: changed logout target
case "logout": //Logout
mysql_query("UPDATE ".DB_PREPEND."phpwcms_userlog SET logged_change=".time().", logged_in=0 WHERE logged_user='".$_SESSION["wcs_user"]."' AND logged_in=1;");
session_destroy();
header("Location: ".PHPWCMS_URL."index.php"); //Target Site you want to be shown after logout
exit();
break;
//ENYM.com login-logout-panel: changed logout target

/////
/////
/////
/////
/////
/////


Thats it!


- Got to Admin:
- Create an article and add "Login-Logout Panel" Content Part - add infos there
- Now create users and set them to frontend only (they can go to backend anyway)


3. Make articles visible for logged in users only:
--------------------------------------------------

(with not having the bug to be able to alter the url to get into the hidden content):

Structure level set:

visible 1 (rest is 0)

Articles inside this level set to

visible 1

BUT

not public!!!!! (red eye)


BTW: I have all Frontend users set to FE only, anyway: they can log in into backend. Dont know. Doesn't matter.
Just for your consideration.

/////
/////
/////
/////
/////
/////



Further hints:
--------------


Restrict FE Users possiblities in Admin:

phpwcms.php Add the enym part of the following in the follwing code context
(find the following and change what is commented as the enym part in the next code sample)

//Wenn der User kein Admin ist, anderenfalls
if(!isset($_SESSION["wcs_user_admin"]) || !intval($_SESSION["wcs_user_admin"])) {
unset($wcsnav["admin"]);
//ENYM: wenn sich ein frontenduser anmeldet dann das alles auch nicht zeigen:
unset($wcsnav["admin"]);
unset($wcsnav["articles"]);
unset($wcsnav["modules"]);
unset($wcsnav["vts"]);
//ENYM RESTRICT
//$wcsnav["admin"] = '';
} else {
if($do == "admin") {
//$do = $_GET["do"];
$wcsnav["admin"] = '<strong class="navtexta">'.$wcsnav["admin"].'</strong>';
}
}








How to make the permission thing work. So that you can assign users to be able to access only certain structure levels:
(Thanx to markoehl again)

search in include/inc_front/front.func.inc.php


Code:
$data[$row["acat_id"]] = array( "acat_id" => $row["acat_id"],
"acat_name" => $row["acat_name"],
"acat_info" => $row["acat_info"],
"acat_struct" => $row["acat_struct"],
"acat_sort" => $row["acat_sort"],
"acat_hidden" => $row["acat_hidden"],
"acat_regonly" => $row["acat_regonly"],
"acat_ssl" => $row["acat_ssl"],
"acat_template" => $row["acat_template"],
"acat_alias" => $row["acat_alias"],
"acat_topcount" => $row["acat_topcount"],
"acat_redirect" => $row["acat_redirect"],
"acat_order" => $row["acat_order"],
"acat_timeout" => $row["acat_cache"],
"acat_nosearch" => $row["acat_nosearch"],
"acat_nositemap"=> $row["acat_nositemap"],
"acat_permit" => !empty($row["acat_permit"]) ? explode(',', $row["acat_permit"]) : array()
);

replace with

Code:
//PWmod by markkoehl
$permissioncheck = !$row["acat_permit"] ? 1 : 0;
if (isset($_SESSION["wcs_user_id"]) AND $row["acat_permit"]) {
$temparray = explode(',', $row["acat_permit"]);
foreach($temparray as $value) {
if ($_SESSION["wcs_user_id"] == $value) {
$permissioncheck = 1;
break;
}
}
}

if ($permissioncheck == 1) {
$data[$row["acat_id"]] = array( "acat_id" => $row["acat_id"],
"acat_name" => $row["acat_name"],
"acat_info" => $row["acat_info"],
"acat_struct" => $row["acat_struct"],
"acat_sort" => $row["acat_sort"],
"acat_hidden" => $row["acat_hidden"],
"acat_regonly" => $row["acat_regonly"],
"acat_ssl" => $row["acat_ssl"],
"acat_template" => $row["acat_template"],
"acat_alias" => $row["acat_alias"],
"acat_topcount" => $row["acat_topcount"],
"acat_redirect" => $row["acat_redirect"],
"acat_order" => $row["acat_order"],
"acat_timeout" => $row["acat_cache"],
"acat_nosearch" => $row["acat_nosearch"],
"acat_nositemap"=> $row["acat_nositemap"],
"acat_permit" => !empty($row["acat_permit"]) ? explode(',', $row["acat_permit"]) : array()
);
}
//End PWmod





To make frontend user really frontend users: alter the following in
inc_lib/checklogin.inc.php

replace this line

$sql .= "WHERE logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1";

woith this one:

$sql .= "WHERE logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1 AND logged_section>0";


wait no this does not yet work for me.... sorry
Well then the users cannot acces both Backend and frontend - Sorry no solution yet






THANX: You are done, please send feedback to info@enym.com if you like it :)
much appreciated :)
Do you use phpwcms 1.2.6?
Did you download phpwcms_userpanel_v2.01.rar?
Did you install all the files from phpwcms_userpanel_v2.01.rar?
Did you do all the code changes mentioned in install.txt?
Did you then create a userpanel content part?
[http://www.phpwcms-docu.de/content_parts_en.phtml]

Can we see your site online?

Success! :D
-- Vuurvos --
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

I done all that ... until it say that the rest is optional

and when I add a new article and i add for exemple Text w / image I don't see the buton with creat new content

maybe I have done something wrong ... but now to answer your question:
I use use phpwcms 1.2.6
I have install all the files from phpwcms_userpanel_v2.01.rar
and I made all the changes but until where it say that the rest is ooptional
I did not find any where to create a userpanel content part
ImagePackging design,labels, catalogs,postcards,
ff123
Posts: 172
Joined: Thu 9. Jun 2005, 20:03
Location: The Netherlands
Contact:

Post by ff123 »

Strange that a userpanel canot be added.
You did go to article center -> edit article -> add content part?

Then you should be able to choose the right content part and see a list like this:
Image
-- Vuurvos --
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

unfortunly I don't have something like that there .. I think I will redo the all procedure again :?
ImagePackging design,labels, catalogs,postcards,
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

Post by phalancs »

2 things:

1. Did you really do that:

Code: Select all

add 

to include/inc_lib/article.contenttype.inc.php 

203 => $BL['be_ctype_login'] 

Or alternitavely (its the same): 

replace this: 
24 => $BL['be_ctype_alias'] 

with that: 
24 => $BL['be_ctype_alias'], 
203 => $BL['be_ctype_login'] 

(just to make you mind that comma - no comma in the last line!!) 
2. Did you really copy the language information in the appropriate language file (otherwise there will only be a nlank line).

------------

Fortunately most of the problems so far could easily be solved :)
2008
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

I know that I have but I will do all again to be sure
ImagePackging design,labels, catalogs,postcards,
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

Does anyoane have the files ready modify and can pass me, I think I do something wrong.

Thanks
ImagePackging design,labels, catalogs,postcards,
ff123
Posts: 172
Joined: Thu 9. Jun 2005, 20:03
Location: The Netherlands
Contact:

Post by ff123 »

Login at:
http://www.enym.com/index.php?e_d_hom

username = user
password = phpwcms

Then you can download the files (phpwcms_userpanel_v2.01.rar). :D
-- Vuurvos --
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

Yes thanks..I have that but do you have files that are already modify? :roll:
ImagePackging design,labels, catalogs,postcards,
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

here are the lines from my: include/inc_lib/article.contenttype.inc.php
//Content Type für Artikel -> nicht ändern
$wcs_content_type = array(
0 => $BL['be_ctype_plaintext'] ,
6 => $BL['be_ctype_html'],
14 => $BL['be_ctype_wysywig'],
11 => $BL['be_ctype_code'],
1 => $BL['be_ctype_textimage'],
2 => $BL['be_ctype_images'],
4 => $BL['be_ctype_bulletlist'],
100 => $BL['be_ctype_ullist'],
3 => $BL['be_ctype_link'],
5 => $BL['be_ctype_linklist'],
8 => $BL['be_ctype_linkarticle'],
15 => $BL['be_ctype_articlemenu'],
9 => $BL['be_ctype_multimedia'],
7 => $BL['be_ctype_filelist'],
25 => $BL['be_ctype_filelist1'],
16 => $BL['be_ctype_ecard'],
//17 => $BL['be_ctype_blog'],
10 => $BL['be_ctype_emailform'],
23 => $BL['be_ctype_simpleform'],
12 => $BL['be_ctype_newsletter'],
13 => $BL['be_ctype_search'],
18 => $BL['be_ctype_guestbook'],
19 => $BL['be_ctype_sitemap'],
20 => $BL['be_ctype_bid'],
21 => $BL['be_ctype_pages'],
22 => $BL['be_ctype_rssfeed'],
50 => $BL['be_ctype_reference'],
51 => $BL['be_ctype_map'],
52 => $BL['be_ctype_phpvar'],
53 => $BL['be_ctype_forum'],
24 => $BL['be_ctype_alias'],
203 => $BL['be_ctype_login']
);

?>
Is it ok or not?
ImagePackging design,labels, catalogs,postcards,
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

Hi friends a realy strange thing is that the script was there from the start but the realy strange is the fact that in the dropdown menu the last line where it should be the userpanel is a blank space.. is not apear the name so that's why I say that is not working... anyway how can I make it to be visible the name in the dropdown menu?
and also here how it look by me ..I have no text that explain the filds ?!!!!?
Image
ImagePackging design,labels, catalogs,postcards,
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

Ups it seams that I forghot to put the xode in lang-inc.php

:oops:
ImagePackging design,labels, catalogs,postcards,
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

OK now I realydo't know how to make visible the login panel in the site can sombody explain me becouse I did not get it from the post

or give me some link for a user manul for this userpanel

Thanks a lot
ImagePackging design,labels, catalogs,postcards,
typoid
Posts: 16
Joined: Wed 25. Jan 2006, 18:12

Post by typoid »

hmm, sorry culda_a but again, I think everything has been said.

Manual is included and everything is in this thread more than a few times. And what do you mean with "send modified files"? Follow instructions, or leave it! It cannot be explained easier.

Sorry but this makes me angry. You are flaming this thread with your redundand posts and your advertisement but you are not willing to at least read the f* manual......

this ain't cool. No plan at all but offering web design.....

:evil: :evil:

(not meant personal)
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

I don't know why it makes you angry, if you read up I solved all the problems alone what I did not get is how to put the login form I don't post only if necessary.
I try to folow the instruction in the forum and I did not succed that's why I post in here.

Last time I check it was a forum open for discusion in case that somebody have any question... I don't know why you are so angry :roll:

I see that is disturb ou my signeture... I'm not a programer I'm a designer but maybe you have been born with all the knowldge abou programing ... Great for you and HAVE A NICE DAY I was aspecting here an answer not your opinion
THANKS again to the great comunity that is here but they are some that are only critics :roll:
ImagePackging design,labels, catalogs,postcards,
Post Reply