Change list for xxx.C#-Online.NET

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search

This is a change list to follow for setting up C# Online.NET sites in various languages.

Contents

Special:Allmessages

Update and translate these System messages:

  • mainpage to Main()
  • Pagetitle
  • portal
  • sitetitle
  • tagline

Installation

  • CPanel / MySQL Databases
    • Create database
    • Add administrative user to database (create if necessary)
  • Run installer (access URL)
  • Move /config/LocalSettings.php to home directory

Sidebar navigation

Google and Yahoo sitemap support

  • Add this to .htaccess:

# Rewrite for Google sitemap
RewriteRule ^sitemap.xml$ /googleSitemap.php [L]
# Rewrite for Yahoo sitemap
RewriteRule ^urllist.txt$ /yahooSitemap.php [L]

Pretty URLS

  • Add this to .htaccess:

# Pretty URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]

AND change these lines in /LocalSettings.php :

$wgArticlePath       = "$wgScriptPath/$1";
#$wgArticlePath      = "$wgScript?title=$1"; 

/LocalSettings.php

  • Add this line to allow lower case first letter on links:
$wgCapitalLinks = false;
  • Change logo graphic from:
$wgLogo = "$wgStylePath/common/images/mediawiki.png";

to:

$wgLogo = "$wgStylePath/common/images/CSOLogo4.gif";
  • Enable file uploads:
$wgEnableUploads = false;

to:

$wgEnableUploads = true;
  • Limit skin choices in preferences by adding this:
# To remove various skins from the User Preferences choices
$wgSkipSkins = array("chick", "cologneblue", "myskin", 
   "nostalgia", "simple", "standard");
  • Add to LocalSetting.php so editing requires registration:
$wgGroupPermissions['*' ]['createaccount'] = true;
$wgGroupPermissions['*' ]['read'] = true;
$wgGroupPermissions['*' ]['edit'] = false;
  • Add to LocalSetting.php so registration requires e-mail confirmation:
$wgEmailConfirmToEdit = true;

after:

$wgEnableEmail      = true;
$wgEnableUserEmail  = false;
  • Add extensions to /LocalSettings.php after uploading them. See /extensions.
  • To allow .zip uploads, add these lines:
# allow zip extensions
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'zip');

To link to .zip files, use this link format: Download .zip

Miscellaneous files to copy

  • Change Main Page logo by copying CSOLogo4.gif logo image to /skins/common/images
  • Copy favicon.ico to home directory
  • Copy robots.txt to home directory

/robots.txt

Edit robots.txt for this site; then, copy robots.txt to home directory. For example, words for "Template" and "Special" will be different.

/extensions

  • Modify URLs in:
    • CSO_BasicAmazon.php
    • CSO_SiteAd.php
  • Move the following extensions to /extensions:
    • CSO_BasicAmazon.php
    • CSO_iFrame.php
    • CSO_SiteAd.php
    • CSO_Source.php
    • /geshi
  • Then add to /LocalSettings.php:
include("extensions/CSO_iFrame.php");	    # CSO_iFrame extension
#include("extensions/CSO_RSS.php");	    # CSO_RSS extension
include("extensions/CSO_SiteAd.php");	    # CSO_SiteAd extension
include("extensions/CSO_Source.php");  	    # CSO_Source.php GeSHi extension
include("extensions/CSO_BasicAmazon.php");  # CSO_BasicAmazon.php extension 

/images

  • Move /images to new site.

/includes

  • Modify URLs in:
    • AdSearch.php
  • Move these files to /includes:
    • AdSearch.php
    • AdSenseReferral.php
    • AdWordsReferral.php
    • BottomBanner.php
    • RightTower.php
    • TopLeftLink.php
  • To open new window for offsite URLs, change /includes/Linker.php from:
function getExternalLinkAttributes( $link, $text, $class='' ) {
   $link = htmlspecialchars( $link );
 
   $r = ($class != '') ? " class='$class'" : " class='external'";
 
   $r .= " title=\"{$link}\"";
   return $r;
   }

to (be sure to change www.csharp-online.net to the correct domain):

function getExternalLinkAttributes( $link, $text, $class='' ) {
   $link = htmlspecialchars( $link );
 
   $r = ($class != '') ? " class='$class'" : " class='external'";
 
   if ( substr($link,0,28) != 'http://www.csharp-online.net')
      {
      $r .= " target=\"offsite\"";	# Open in new window
      }
   $r .= " title=\"{$link}\"";
   return $r;
   }
  • To add page keywords, change /includes/OutputPage.php (1.5.x only?) from:
function addMetaTags () {
...
   $wgOut->addMeta ( 'KEYWORDS' , $a ) ;
   }

to:

function addMetaTags () {
...
   /* $wgOut->addMeta ( 'KEYWORDS' , $a ) ; */
   $wgOut->addMeta ( 'KEYWORDS' , $a.',C# Online.NET, CSharp-Online.NET, C#, C# help, C# tutorial, C# article,C# source code,C# example,C# code snippet') ;
   }

/skins/Monobook.php

  • Change Monobook.php from:
<div id="footer">
<?php
		if($this->data['poweredbyico']) { ?>
				<div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
<?php 	}
		if($this->data['copyrightico']) { ?>
				<div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
<?php	}
 
		// Generate additional footer links
?>
			<ul id="f-list">
<?php
		$footerlinks = array(
			'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
			'privacy', 'about', 'disclaimer', 'tagline',
		);
		foreach( $footerlinks as $aLink ) {
			if( $this->data[$aLink] ) {
?>				<li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
<?php 		}
		}
?>
			</ul>

to:

<div id="footer">
<!-- Google AdSense -->
<p><?php include("includes/BottomBanner.php") ?></p>
	<ul id="f-list">
	  <?php if($this->data['about'     ]) { ?><li id="f-about"><?php      $this->html('about')      ?></li><?php } ?>
	  <?php if($this->data['disclaimer']) { ?><li id="f-disclaimer"><?php $this->html('disclaimer') ?></li><?php } ?>
	  <?php if($this->data['lastmod'   ]) { ?><li id="f-lastmod"><?php    $this->html('lastmod')    ?></li><?php } ?>
	  <?php if($this->data['viewcount' ]) { ?><li id="f-viewcount"><?php  $this->html('viewcount')  ?></li><?php } ?>
	  <?php if($this->data['numberofwatchingusers' ]) { ?><li id="f-numberofwatchingusers"><?php  $this->html('numberofwatchingusers') ?></li><?php } ?>
	  <?php if($this->data['credits'   ]) { ?><li id="f-credits"><?php    $this->html('credits')    ?></li><?php } ?>
	  <?php if($this->data['copyright' ]) { ?><li id="f-copyright"><?php  $this->html('copyright')  ?></li><?php } ?>
	  <?php if($this->data['tagline']) { ?><li id="f-tagline"><?php echo $this->data['tagline'] ?></li><?php } ?>
	  </ul>
      </div>
  • After language_urls, add to /skins/Monobook.php:
<div class="portlet" id="p-tb">
	  <h5>C# Online.NET sister sites</h5>
	  <div class="pBody">
	    <ul>
	    <li><a href="http://wiki.csharp-online.net/">English</a></li>
	    <!-- li><a href="http://de.csharp-online.net/">German</li -->
	    <li><a href="http://es.csharp-online.net/">Spanish</a></li>
	    </ul>
	  </div>
	</div>
  • Necessary? To add favicon.ico, change /skins/Monobook.php from:
<title><?php $this->text('pagetitle') ?></title>
		<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?7"; /*]]>*/</style>
		<link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />

to:

<title><?php $this->text('pagetitle') ?></title>
		<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?7"; /*]]>*/</style>
		<link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
	    <link rel="icon" href="http://es.csharp-online.net/favicon.ico" type="image/x-icon" />

/skins/monobook/main.css

  • To enable MediaWiki:tagline change /skins/monobook/main.css from:
#siteSub {
    display: none;
}

to:

#siteSub { display: inline; font-size: 85%; font-weight: normal;} 
/*
#siteSub {
    display: none;
}
*/
  • Ad Google ad column:
#column-google
   { 
   width: 120px; 
   clear: left; 
   position: absolute; 
   padding: 35px 0px 6px 6px; 
   float: right; 
   right: 0px;
   top: 3px; 
   z-index: 5; 
   }
  • change:
#content {
	margin: 2.8em 0 0 12.2em;

to

#content {
/*  margin: 2.8em 0 0 12.2em; */
    margin: 2.8em 130px 0 12.2em;

change

#footer {
	background-color: white;
	border-top: 1px solid #fabd23;
	border-bottom: 1px solid #fabd23;
	margin: .6em 0 1em 0;

to

#footer {
    background-color: white;
    border-top: 1px solid #fabd23;
    border-bottom: 1px solid #fabd23;
/*  margin: .6em 0 1em 0; */
    margin: .6em 130px 1em 0;


  • To change <code> tag appearance, change /skins/monobook/main.css from
code {
	background-color: #f9f9f9;
}

to

code {
    font-family: 'Courier New', 'Lucinda Console', monospace, serif;
    font-weight: normal;
    color: navy; 
}

Add buttons to Edit page

1. Create a graphic for the function using the /skins/common/images/button_template.png blank button.

2. Add an entry for your function in the $toolarray table of /includes/EditPage.php:

array(	'image'	=>'button_code.png',
   'open'	=>	'<code>',
   'close'	=>	'</code>',
   'sample'=>	'partial',
   'tip'	=>	'Surround with code tags',
   'key'	=>	'c'
   ),
array(	'image'	=>'button_source.png',
   'open'	=>	'<CSO_Source>',
   'close'	=>	'<//CSO_Source>',
   'sample'=>	'i += 1;',
   'tip'	=>	'Surround with CSO_Source tags',
   'key'	=>	's'
   )

Personal tools