Author Topic: Edit this page as code snippet module  (Read 18945 times)

Offline RolfP

  • Posts: 18
Edit this page as code snippet module
« on: December 23, 2007, 12:06:27 PM »
Hi,

I modified the code posted at http://forum.WebsiteBaker.org/index.php/topic,2352.0.html and created a module.
This module adds an image in template where ever you put the code
<?php frontend_edit(); ?> if the logged in account is allowed to edit the page.

On clicking image the backend editor opens the selected page.

See the attached modul.

Have fun.

Rolf


[gelöscht durch Administrator]

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8411
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Edit this page as code snippet module
« Reply #1 on: December 23, 2007, 12:30:00 PM »
Hello,

well done, easy to install, very easy to handle. Great snippet.

Thanks for your contribution to WB.

Matthias

berta

  • Guest
Re: Edit this page as code snippet module
« Reply #2 on: January 04, 2008, 08:30:39 AM »
Rolf,
Thank you for your module, it works great, and makes it so much easier to ask other people to edit the pages. THANKS
Berta

Offline diodak

  • Posts: 85
Re: Edit this page as code snippet module
« Reply #3 on: January 22, 2008, 12:33:15 PM »
You didnt notice that front login must be enabled. Good module.
Buchsbaum

Offline JonH

  • Posts: 25
Re: Edit this page as code snippet module
« Reply #4 on: January 25, 2008, 01:44:07 PM »
Where's the attachment?

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8411
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Edit this page as code snippet module
« Reply #5 on: January 25, 2008, 01:50:24 PM »
in the first post  :-D

Offline JonH

  • Posts: 25
Re: Edit this page as code snippet module
« Reply #6 on: January 25, 2008, 03:16:48 PM »
I swear it wasn't there before!  :-D

Offline fsuk

  • Posts: 127
Re: Edit this page as code snippet module
« Reply #7 on: July 18, 2008, 04:32:48 PM »
Needs to be updated for 2.7, only works with the default group_id and not the group_ids field. i might give it ago if i have time, that is of couse unless theres a feature like this already built into 2.7??
You say deviant like its a bad thing...

Offline fsuk

  • Posts: 127
Re: Edit this page as code snippet module
« Reply #8 on: August 07, 2008, 03:39:24 PM »
I have updated the module for WB 2.7 for multiple groups.

Theres probably some redundant code in there.

The updated module is attatched.

[gelöscht durch Administrator]
« Last Edit: August 07, 2008, 04:17:14 PM by fsuk »
You say deviant like its a bad thing...

aldus

  • Guest
Re: Edit this page as code snippet module
« Reply #9 on: August 07, 2008, 04:04:10 PM »
Sorry for the german:
so:
I cleaned it a little bit up ... e.g. no nessesay new database() needed,
and collecting the data before echo.

where are two variables left
- $old_admin_users und
- $admin_users.

both of them are only used one time - and never more; so they can be left/removed.

Regards
Aldus

[gelöscht durch Administrator]
« Last Edit: August 07, 2008, 04:08:01 PM by aldus »

Offline fsuk

  • Posts: 127
Re: Edit this page as code snippet module
« Reply #10 on: August 07, 2008, 04:10:42 PM »
Thanks ill add it to the zip in my previous post
You say deviant like its a bad thing...

aldus

  • Guest
Re: Edit this page as code snippet module
« Reply #11 on: August 07, 2008, 04:23:15 PM »
But please test it before  :-D
I've made mass. changes ...

Regards
Aldus

Offline fsuk

  • Posts: 127
Re: Edit this page as code snippet module
« Reply #12 on: August 07, 2008, 04:26:08 PM »
Yup it works fine, although i had to remore /n from the end of the Edit Page line as it wasnt starting a new line just printing '/n'
You say deviant like its a bad thing...

Offline TN

  • Posts: 29
Re: Edit this page as code snippet module
« Reply #13 on: September 07, 2008, 02:50:17 PM »
I swear it wasn't there before!  :-D

You can see the attachment only if you are logged in, if you have cookies allowed und if you have javascript allowed.

I think: not everybody should gets the code   :evil:

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Edit this page as code snippet module
« Reply #14 on: September 18, 2008, 09:19:55 PM »
Hello!
This is a great upgrade!

I only have one question:
How can I modify the <?php frontend_edit(); ?> 
so I get a message when this snippet is not installed.

Thanks in advance.
Stefek
« Last Edit: September 18, 2008, 10:43:48 PM by Stefek »
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

doc

  • Guest
Re: Edit this page as code snippet module
« Reply #15 on: September 18, 2008, 10:07:05 PM »
Hi,

like done for the register_frontend_m odfiles function called in the index.php of the most templates out there, so:

Code: [Select]
<?php
if (function_exists(&#39;frontend_edit&#39;)) {
  
frontend_edit();
} else {
  echo &
#39;Sorry, to use this function, you need to install the code snippet xxx first.&#39;;
}
?>

Regards Christian
« Last Edit: September 18, 2008, 11:17:51 PM by doc »

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Edit this page as code snippet module
« Reply #16 on: September 18, 2008, 10:44:22 PM »
Thanks Christian!

Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

mr-fan

  • Guest
Re: Edit this page as code snippet module
« Reply #17 on: September 22, 2008, 07:35:09 PM »
i have a question about the frontedit...

is it possible to make it easyer for a simple editor, after he made changes to his site, that he can with one click back to frontend.... or is this to complex in the backend....

or is there a other option that makes a sucess from a user to only one site to edit...save and look changes....in the frontend?

mfg mr-fan

erpe0812

  • Guest
Re: Edit this page as code snippet module
« Reply #18 on: September 23, 2008, 08:27:04 AM »
A click to the button and he turns to the frontend  in new tab (see image)

rgds

erpe

[gelöscht durch Administrator]

mr-fan

  • Guest
Re: Edit this page as code snippet module
« Reply #19 on: September 23, 2008, 12:20:01 PM »
ups.... sry i only used the big red one  :-D

my brain is jumping to fast to think..... :roll:

greets

Offline jrast

  • Posts: 315
  • Gender: Male
Re: Edit this page as code snippet module
« Reply #20 on: February 23, 2009, 10:59:39 AM »
If i want to add a new group, i get this error:
Code: [Select]
Parse error: syntax error, unexpected T_VARIABLE in /home/opentopo/public_html/wb/modules/frontedit2.7/info.php on line 1
So, why do i get a error from a snippet if i want to add a new group in the WB backend? for me a strange thing...

@edit:
ok, Problem found.
the info.php file was in a wrong format and there was no white space betwen the <?php tag and the first variable.
« Last Edit: February 23, 2009, 11:21:31 AM by jrast »
- If life turns bad, just hang on! -

solbu

  • Guest
Re: Edit this page as code snippet module
« Reply #21 on: March 12, 2009, 08:13:28 PM »
This module adds an image in template where ever you put the code
<?php frontend_edit(); ?> if the logged in account is allowed to edit the page.
I have a bug report.
If one use the Search function to search the portal as guest and is not logged in, the Edit link, with the image, shows up regardless of whether one is loged in or not. Clicking the Edit link results in one having to login thou, but still, it should not be displayed.

This only happens on the search page. (websitebakerurl/search/index.php)


I have tried to locate why it show up there as guest, but I am unable to figure it out.

mr-fan

  • Guest
Re: Edit this page as code snippet module
« Reply #22 on: March 12, 2009, 09:29:47 PM »
Quote
I have a bug report.
If one use the Search function to search the portal as guest and is not logged in, the Edit link, with the image, shows up regardless of whether one is loged in or not. Clicking the Edit link results in one having to login thou, but still, it should not be displayed.

This only happens on the search page. (websitebakerurl/search/index.php)

i just have a short try - i don't can confirm this on my site! we have a site with the maincontent is for unregistered/unlogged in users and a short part is for spezial users with login!

i've the frontedit placed in the site - with your report i've tryed out imediatly but no such manner in my case!

mean guest in your case - no login or no access to edit a site??

because if you logged in and have no access to edit site - the fronteditbutton will display anyway...

rgds martin

solbu

  • Guest
Re: Edit this page as code snippet module
« Reply #23 on: March 12, 2009, 09:46:53 PM »
mean guest in your case - no login or no access to edit a site??
Correct. The user is not logged in.
On every page on the site, guest users do not see the image. However if the guest user use the search function, the edit image appears also for guests.

This happens Only on the /search/index.php page, where the search results also apears.

solbu

  • Guest
Re: Edit this page as code snippet module
« Reply #24 on: March 13, 2009, 02:34:22 PM »
On every page on the site, guest users do not see the image. However if the guest user use the search function, the edit image appears also for guests.

This happens Only on the /search/index.php page, where the search results also apears.
I have just noticed another problem, that might help in debugging. Logged in users Do Not get the Edit image on the search page. The site owner noticed it.

We are in the process of launching a new design, using WebsiteBaker for the first time, and are trying various things. :) This is the last remaning bug we need to resolve before we can launch the new CMS.
« Last Edit: March 13, 2009, 02:36:20 PM by solbu »