Thickbox iframe onload
Oct 22, 2008 in Webdev
$(document).ready(function(){
tb_show('title here','/page.html?keepThis=true&TB_iframe=true&height=260&width=400');
});
random writings
Oct 22, 2008 in Webdev
$(document).ready(function(){
tb_show('title here','/page.html?keepThis=true&TB_iframe=true&height=260&width=400');
});
Oct 21, 2008 in Webdev
<xsl:for-each select="/page/contentframe/pageerrors/error">
<xsl:value-of select="@value"/>
<xsl:if test="position() < last()-1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="position()=last()-1">
<xsl:text>, and </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>!</xsl:text>
</xsl:if>
</xsl:for-each>
Aug 22, 2008 in Linux, Webdev, php
Install from Ubuntu repository
sudo apt-get install phpgedview
Configure PhpGedView with MySQL
sudo gedit /etc/phpgedview/config.php
$DBTYPE = "mysql";
$DBHOST = "localhost";
$DBUSER = "phpgedview_my_family";
$DBPASS = "password_for_dbuser";
$DBNAME = "phpgedview_my_family";
Setup virtual host
sudo gedit /etc/apache2/apache2.conf
Alias /gedview /usr/share/phpgedview/www
<directory /usr/share/phpgedview/www>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</directory>
Restart Apache
sudo /etc/init.d/apache2 restart
Ubuntu 8.04 repository bug: Fails to install the root .js files, copy these scripts to /usr/share/phpgedview/www
Aug 16, 2008 in gallery
How to change gallery2 column output
# 1. Navigate to: /modules/search/
# 2. Find SearchScan.inc . This controls the number of returned searches, so our first step is to modify this file. ** Be sure to take a copy somewhere safe on your PC before modifying anything**
# 3. Find line number 113 which reads:
/* TODO: Parameterize this */
$scanSize = 3;
4. This value controls the maximum number of results. In this example we will create 12 so we change the following:
$scanSize = 12;
# As you can see we have got 12 searches BUT gallery2 has strung them into one big line, and it goes totally off the screen in one big table.
# 6. NEXT we tell Gallery2 to insert table breaks to create a nice structure. For this example we will set it to 4 items per line.
# 7. We have to change directory into: /modules/search/templates/
# 8. Find this file: SearchScan.tpl – back it up!
# 9. Open this file and find line 95 which reads:
{assign var="searchCriteria" value=$form.searchCriteria}
{if (sizeof($results.results) > 0)}
<table><tr>
{foreach from=$results.results item=result}
{assign var=itemId value=$result.itemId}
10. This is the start of the loop which controls the output so we have to add a line or two in here to control the output:
{assign var="searchCriteria" value=$form.searchCriteria}
{assign var="childrenInColumnCount" value=0}
{if (sizeof($results.results) > 0)}
<table><tr>
{foreach from=$results.results item=result}
{* Move to a new row *}
{if ($childrenInColumnCount == 4)}
</tr><tr>
{assign var="childrenInColumnCount" value=0}
{/if}
{assign var=childrenInColumnCount value="`$childrenInColumnCount+1`"}
{assign var=itemId value=$result.itemId}