.weblog engine
FAQ :: Search ::  Memberlist ::  Register :: Profile ::  Usergroups ::  Log in
Log in to check your private messages ::  Download Pivot :: Support Pivot | Info
Platinum Sponsors have their names added to the footer
of every page of the Support Forum. Yours could be there too!
GeSHi to Publish Code in Pivot

 
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Releases
View previous topic :: View next topic  
Author Message
pr0gr4mm3r
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 09 Nov 2006
Posts: 13

PostPosted: Fri Mar 09, 2007 4:34 pm    Post subject: GeSHi to Publish Code in Pivot Reply with quote

Extension Name: GeSHi for Pivot
Extension Author: pr0gr4mm3r
Download Location: Attached

Extension Description:
    GeSHI for Pivot is a syntax highlighter based on GeSHi.
    This one is pretty straight forward, but there are two things you will have to do for this to work.

      Setup:
      • First, create a 'code' folder in your Pivot directory.
      • Second, you are responsible for downloading the GeSHi classes and installing them on your site. You will have to include the main GeSHi class if you don't use PHP's __autoload() function.


      Usage:
      • Create the code and save them as text files in your code folder.
      • Then call it like this: [[geshi:code.txt:php]] where 'code.txt' is the filename of the code file, and 'php' is the language of the code file.


      If you want the snippet to have the option to have users download the code instructions can be found at the link below.

      A sample of the snippet in action: [link]


Note: Please post all questions and discussions about this extension in this thread. Keeping the discussion confined to one thread will help others if they have any questions.



snippet_geshi.php.zip
 Description:
GeSHi to Publish Code in Pivot

Download
 Filename:  snippet_geshi.php.zip
 Filesize:  1.18 KB
 Downloaded:  578 Time(s)

Back to top
View user's profile Send private message
Tenshi
Platinum Sponsor
<b>Platinum Sponsor</b>


Joined: 12 Apr 2003
Posts: 1598
Location: Enschede, The Netherlands

PostPosted: Sat Mar 10, 2007 9:17 am    Post subject: Re: GeSHi to Publish Code in Pivot Reply with quote

Thanks, this one is really usefull for my future posts! Smile
_________________
bramn - When just a first name is not enough!
Back to top
View user's profile Send private message MSN Messenger
idris
Pivot Groupie In Training
Pivot Groupie In Training


Joined: 30 Mar 2009
Posts: 6

PostPosted: Sat Apr 04, 2009 2:18 am    Post subject: Re: GeSHi to Publish Code in Pivot Reply with quote

Just thought I'd add more detailed instructions as some things weren't obvious to me.


  1. Download geshi and extract it to somewhere on your web server - I put mine in /home/id/include/
  2. Download the snippet code, extract the source file and copy everything from it except the <php> and ?> tags to your clipboard.
  3. Paste that code into the file pivot/modules/module_snippets.php, at the end of the file but before the closing ?> tag.
  4. Add the line:
    Code:
    include("/home/id/include/geshi/geshi.php");

    to the top of the file, after the <?php tag. (Obviously substituting the correct path)
  5. Create the dir pivot/code and put some files in it

Now, when you type e.g. [[geshi:file.php:php]] in an entry, it'll plonk in a code viewer panel.


Sorry if this is obvious but I've never installed a snippet thing before and I'm sure someone else will find this extra bit of detail useful.

Cheers,
Id
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Sat Apr 04, 2009 4:57 am    Post subject: Re: GeSHi to Publish Code in Pivot Reply with quote

First of all you might want to consider trying the Codepress extension. Secondly, your instructions are very, very wrong. It's not that hard to add extensions to Pivot. The correct procedure is:

1) Download, then unzip snippet_geshi.php.zip and put snippet_geshi.php in your extensions/snippets/ directory.
2) Download Geshi and extract/unzip into the extensions directory.

If the Geshi snippet had been coded correctly, this would have been all that was needed. However, the lines
Code:
//Loading the Geshi class
require_once($Paths['extensions_path'].'geshi/geshi.php');

must be inserted before
Code:
function snippet_geshi($code_loc, $code_lang) {


NB! Never, ever edit the core files like modules/module_snippet.php.

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Releases All times are GMT - 4 Hours
Page 1 of 1
|
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Your generosity is appreciated!
Gambling News was the last to make a donation
:: go here for sponsorship information ::
Special thanks to our platinum sponsors: Gambling News  
DreamHost

powered by phpBB | RSS Feed