Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Adding code to a file.  (Read 5528 times)

0 Members and 1 Guest are viewing this topic.

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Adding code to a file.
« 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,
« Last Edit: October 02, 2007, 07:40:36 am by GauGau »
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Nibbler

  • Guest
Re: Adding code to a file.
« Reply #1 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.
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Adding code to a file.
« Reply #2 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,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Nibbler

  • Guest
Re: Adding code to a file.
« Reply #3 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,
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Adding code to a file.
« Reply #4 on: September 30, 2007, 06:44:11 pm »

Ok, a mod it is.

Thanks,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.