Insert Custom Scripts (HTML and Javascript)

brijeshb

Joined: 2009-01-19
Posts: 1
Posted: Mon, 2009-01-19 09:13

/* Tags: insert javascript, html code snippets, visitor maps, cluster maps, maps */
Hi,
I wanted to insert custom scripts into my gallery2 website and finally managed to do it without any errors.
This post is information for those who would like to do the same.

I wanted to add visitor map widget from http://whos.amung.us to my gallery2 website. The gallery uses the Carbon theme and here is how I embedded the tags into the sidebar.

1. Open .....themes/carbon/templates/sidebar.tpl

2. After this part of the existing code

        <!-- #####  Existing Code in sidebar.tpl  ##### -->
        <div id="gsSidebar" class="gcBorder1">
          {* Show the sidebar blocks chosen for this theme *}
          {foreach from=$theme.params.sidebarBlocks item=block}
            {g->block type=$block.0 params=$block.1 class="gbBlock"}
          {/foreach}
        </div>
        <!-- #################### -->
        

Insert the following code from http://whos.amung.us website:

       <!-- #####   INSERT THIS   ##### -->
        <div style="width:148px;text-align:center;margin:0;padding:0;">
        <a href="http://whos.amung.us/maps/">Visitor Map!</a>
        <br />
        <embed src="http://widgets.amung.us/flash/v2map.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" allowScriptAccess="always" allowNetworking="all" type="application/x-shockwave-flash" flashvars="wausitehash=ho45waougr1q&map=night&pin=star-orange&link=no" width="148" height="74" />
        <div style="width:148px;height:74px;position:relative;margin:0 auto;margin-top:-74px;">
          <a href="http://whos.amung.us/stats/ho45waougr1q/"><img src="http://maps.amung.us/ping/ho45waougr1q.gif" border="0" width="148" height="74" /></a>
        </div>
        </div>
        <!-- #################### -->
        

and Save the .tpl file.

3. Goto Siteadmin > Maintenance and click Run Now for Delete template cache
4. View the gallery.

Here is my gallery http://photos.brijeshbhaskaran.com. Click the sidebar to see the visitor map.

About my installation:
-----------------------

  1. Gallery version = 2.3 core 1.3.0
  2. API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
  3. PHP version = 5.2.8 cgi
  4. Webserver = Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
  5. Database = mysqlt 5.0.67-community, lock.system=flock
  6. Toolkits = ArchiveUpload, Dcraw, Exif, Ffmpeg, Getid3, ImageMagick, LinkItemToolkit, NetPBM, SquareThumb, Thumbnail, Gd
  7. Acceleration = none, none
  8. Default theme = carbon
  9. gettext = enabled
  10. Locale = en_US
  11. Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
  12. Rows in GalleryAccessMap table = 31
  13. Rows in GalleryAccessSubscriberMap table = 80
  14. Rows in GalleryUser table = 2
  15. Rows in GalleryItem table = 79
  16. Rows in GalleryAlbumItem table = 5
  17. Rows in GalleryCacheMap table = 0