Author Topic: script install  (Read 1013 times)

0 Members and 1 Guest are viewing this topic.

Offline curlin

  • New Member
  • *
  • Posts: 97
  • Karma: 2
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2.0
script install
« on: January 14, 2010, 06:51:06 PM »
      Newbie question and feeling alittle shell shocked from all this forum information i have been trying to absorb lately  :shckd

       I want to put a php script in a block. It has files with it so where do i put them? Do i install through the forum package manager? Trying to do this in a simple portal php block - http://www.phpjunkyard.com/php-guestbook-script.php
Hoss Talk At Thoroughbred Junkie

Offline butchas

  • Elite Member
  • *
  • Posts: 631
  • Karma: 398
  • Illustrious key typer
    • East Coast Rolling Thunder car club
  • SMF Version: 2.0 RC5
Re: script install
« Reply #1 on: January 14, 2010, 07:34:23 PM »
No.  Typically you cut and past the code into your  forum.  But I prefer to do it a little cleaner.

In "$boarddir/index.php" I look for:
:
require_once($sourcedir . '/Security.php');
and add after it with:
:
require_once($sourcedir . '/yourscript.php');]
Where "yourscript.php" is the script you want.  The all you have to do is call it anywhere in one of your xx.index.php files.

Say for example yourscript had a function called "main_stuff()".  All you will need to do is insert the following:

:
main_stuff();
anywhere between echo ' .... ; statements...

Check it first with a debugger.  :dnc
My mod, My site

Offline curlin

  • New Member
  • *
  • Posts: 97
  • Karma: 2
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2.0
Re: script install
« Reply #2 on: January 14, 2010, 07:50:31 PM »
       Great butchas

   Thanks. I'll have a look at that.
Hoss Talk At Thoroughbred Junkie

Offline curlin

  • New Member
  • *
  • Posts: 97
  • Karma: 2
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2.0
Re: script install
« Reply #3 on: January 14, 2010, 09:29:10 PM »
    Is there scripts that you can just paste into a php, html block in simple portal?
Hoss Talk At Thoroughbred Junkie

Offline butchas

  • Elite Member
  • *
  • Posts: 631
  • Karma: 398
  • Illustrious key typer
    • East Coast Rolling Thunder car club
  • SMF Version: 2.0 RC5
Re: script install
« Reply #4 on: January 15, 2010, 02:34:21 PM »
I do not know about simple portal but if it allows scripts to be pasted in go for it.   :great
My mod, My site

Offline curlin

  • New Member
  • *
  • Posts: 97
  • Karma: 2
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2.0
Re: script install
« Reply #5 on: January 16, 2010, 12:36:00 PM »
    I played around with tinyportal a few years ago and i coulda swore you could just copy and paste scripts into blocks and they would work without having to install scripts on the server.
Hoss Talk At Thoroughbred Junkie

Offline butchas

  • Elite Member
  • *
  • Posts: 631
  • Karma: 398
  • Illustrious key typer
    • East Coast Rolling Thunder car club
  • SMF Version: 2.0 RC5
Re: script install
« Reply #6 on: January 17, 2010, 02:34:06 PM »
I remember that too.   :p
My mod, My site

Offline Cholo

  • Global Moderator
  • *
  • Posts: 1737
  • Karma: 681
  • Gender: Male
    • The Tarheel Forum
Re: script install
« Reply #7 on: January 17, 2010, 03:02:13 PM »
You should be able to, but with most scripts you have to place some code in the <head> section of the page to make it work.  The script blocks only function as the <body>, so you have to go into the index.template.php and place some code in the <head> area.

Offline curlin

  • New Member
  • *
  • Posts: 97
  • Karma: 2
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2.0
Re: script install
« Reply #8 on: January 17, 2010, 03:54:42 PM »
    Here is one i just found that i simply added to a top block (custom html) in simple portal that is just above the news fader that i'm going to use for frequent updates. Like it.

    http://www.phpbb3bbcodes.com/viewtopic.php?f=4&t=1544
Hoss Talk At Thoroughbred Junkie