forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: just_some_guy on September 30, 2007, 04:30:27 pm

Title: Adding code to a file.
Post by: just_some_guy on September 30, 2007, 04:30:27 pm
I have several sets of php code that need to be inserted to displayimage.php, what do i put in the codebase to achive this?

Thanks,
Title: Re: Adding code to a file.
Post by: Nibbler on September 30, 2007, 04:47:54 pm
You don't. Use the provided plugin hooks and filters or provide instructions to the user about what hooks/filters to add if there are none suitable.
Title: Re: Adding code to a file.
Post by: just_some_guy on September 30, 2007, 06:21:54 pm
Ok, so i would use
Quote
Code: [Select]
$thisplugin->add_filter('file_footer','vhp_file_footer');
to apply the code to displayimage.php.

But i still dont understand how to add code to a specific location example: "code on line 403 of upload.php"

How do i do this?

Thanks,
Title: Re: Adding code to a file.
Post by: Nibbler on September 30, 2007, 06:36:40 pm
You don't. That's what makes a plugin different to a mod. If you need people to make code changes then write it up as a mod instead. Not everything can be made into a plugin,
Title: Re: Adding code to a file.
Post by: just_some_guy on September 30, 2007, 06:44:11 pm
Ok, a mod it is.

Thanks,