copy articles and structures (patch)

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

HI all

I increased the functions of Copy & Paste Article Content in "site structure and article list".
Link: http://ww2.estg.ipleiria.pt/~fbatista/p ... 02,0,0,1,0

My patch for phpWCMS:
Link: http://ww2.estg.ipleiria.pt/~fbatista/p ... hp?phpwcms

Regards
Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
User avatar
Oliver Georgi
Site Admin
Posts: 9951
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

you are great :)

regards
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post by rushclub »

fbatista wrote:HI all

I increased the functions of Copy & Paste Article Content in "site structure and article list".
Link: http://ww2.estg.ipleiria.pt/~fbatista/p ... 02,0,0,1,0

My patch for phpWCMS:
Link: http://ww2.estg.ipleiria.pt/~fbatista/p ... hp?phpwcms

Regards
is this patch working under 1.2.1 also?

cheers
rush
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
deanloh
Posts: 99
Joined: Sat 12. Feb 2005, 05:31
Location: Singapore
Contact:

Post by deanloh »

Hello fbatista

I installed the patch and got this error in article and structure listing pages:

Code: Select all

Fatal error: Call to undefined function: getalttitle() in /home/dlcom/public_html/include/inc_lib/admin.functions.inc.php on line 167
I have previously done copy article patch, could that be the reason why? Do I need to remove article copy in order to use article content copy? I'm using RC4 (somehow I have strong feeling this is for 1.2.1 only)

I'm glad I backup!
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

Ok

This patch working under 1.2+.
But i think this patch working in RC4+ with this function :
"File: general.inc.php"

Code: Select all

function getAltTitle($string='', $altAndTitle=0, $echo=0) {
	$attribute = trim($string);
	switch(intval($altAndTitle)) {	
		case 0:	// alt and title attribute
				$attribute = 'alt="'.$attribute.'" title="'.$attribute.'"';
				break;
		case 1:	// alt only
				$attribute = 'alt="'.$attribute.'"';
				break;
		case 2:	// alt only
				$attribute = 'title="'.$attribute.'"';
				break;
	}
	if($echo != 0) {
		echo $attribute;
	} else {
		return $attribute;
	}
}
Regards
Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
deanloh
Posts: 99
Joined: Sat 12. Feb 2005, 05:31
Location: Singapore
Contact:

Post by deanloh »

fbatista wrote:Ok

This patch working under 1.2+.
But i think this patch working in RC4+ with this function :
"File: general.inc.php"

Code: Select all

function getAltTitle($string='', $altAndTitle=0, $echo=0) {
	$attribute = trim($string);
	switch(intval($altAndTitle)) {	
		case 0:	// alt and title attribute
				$attribute = 'alt="'.$attribute.'" title="'.$attribute.'"';
				break;
		case 1:	// alt only
				$attribute = 'alt="'.$attribute.'"';
				break;
		case 2:	// alt only
				$attribute = 'title="'.$attribute.'"';
				break;
	}
	if($echo != 0) {
		echo $attribute;
	} else {
		return $attribute;
	}
}
Regards
I assume I should insert the bunch of codes into general.inc.php so I did, and I got this error now (notice it only shows the welcome page):
Image
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

oh so sweet the smell of freedom!
when Oliver gave us the copying of articles I felt the 'binds that tied' had been loosened, now I can smell the green green grass of freedom

... or a little less mellow-dramatic.. it's sik dude, respec' ;)
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Great work Fernando!! respect.

I changed at some installations, works great.

what is changed in "inc_lang" file? So I can made changes for german language support.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

pSouper wrote:oh so sweet the smell of freedom!
when Oliver gave us the copying of articles I felt the 'binds that tied' had been loosened, now I can smell the green green grass of freedom

... or a little less mellow-dramatic.. it's sik dude, respec' ;)
Hi pSouper

I am not to perceive.
I can't speak english, and just a little write english.

This ideia was yours
http://www.phpwcms.de/forum/viewtopic.p ... ght=#37084

Thanks
I was to need this function.
Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

cyrano wrote:Great work Fernando!! respect.

I changed at some installations, works great.

what is changed in "inc_lang" file? So I can made changes for german language support.
Hi. Tks

In "inc_lang\backend\en\lang.inc.php" I add it:

$BL['be_func_content_edit'] = 'edit this article content part';
$BL['be_func_content_paste0'] = 'paste in article';
$BL['be_func_content_paste'] = 'paste later article content part';
$BL['be_func_content_cut'] = 'cut this article content part';
$BL['be_func_content_no_cut'] = "It's not possible to cut the article content part!";
$BL['be_func_content_copy'] = 'copy this article content part part';
$BL['be_func_content_no_copy'] = "It's not possible to copy the article content part!";
$BL['be_func_content_paste_cancel'] = 'cancel article content part change';

Regards
Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

H,

i changed this copy/paste for german Users.

Put the "lang.inc.php" in "include/inc_lang/backend/de/lang.inc.php" to have german text on rollover the icons.

http://www.weitzeldesign.de/lang_inc.zip

or replace the english one with this:

Code: Select all

// added: 31-03-2005 -- copy&paste Article Content - Fernando Batista http://fernandobatista.web.pt
$BL['be_func_content_edit']              = 'Diesen Artikel Contentpart editieren';
$BL['be_func_content_paste0']            = 'In Artikel einfügen';
$BL['be_func_content_paste']             = 'später in Artikel einfügen';
$BL['be_func_content_cut']               = 'Diesen Artikel Contentpart ausschneiden';
$BL['be_func_content_no_cut']            = "Es ist nicht möglich diese Artikel Contentpart auszuschneiden!";
$BL['be_func_content_copy']              = 'Diesen Artikel Contentpart kopieren';
$BL['be_func_content_no_copy']           = "Es ist nicht möglich den Artikel Contentpart zu kopieren!";
$BL['be_func_content_paste_cancel']      = 'Abbrechen des Kopiervorgangs';
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

hello fbatista

you say the idea was mine? I tihnk it was you that gave me the idea... who posted the original thread ? :D
I only made a list but I will take all the credit for your hard labour if you are so modest ;)

I would like to say thanks again for the hack though.
fbatista
Posts: 36
Joined: Tue 2. Nov 2004, 21:53
Location: Portugal
Contact:

Post by fbatista »

pSouper wrote:hello fbatista

you say the idea was mine? I tihnk it was you that gave me the idea... who posted the original thread ? :D
I only made a list but I will take all the credit for your hard labour if you are so modest ;)

I would like to say thanks again for the hack though.
hi pSouper.

My original ideia was very complicated.
But after seeing your thread :
http://www.phpwcms.de/forum/viewtopic.p ... ght=#37084
I found good and relatively simple the ideia for implementing.
Therefore already it had made "copy articles and structures".

Thanks for yours consideration.
Fernando Batista
_______________________________________
Department of Mechanical Engineering (DEM)
School of Technology and Management (ESTG)
Polytechnic Institute of Leiria (IPL)
HOME: http://fernandobatista.net
deanloh
Posts: 99
Joined: Sat 12. Feb 2005, 05:31
Location: Singapore
Contact:

Post by deanloh »

Simply a work of art. fbatista, you are the man! :)
Post Reply