Hi there,

Please consider registering for an account. Registration is free, only takes a minute and will allow you to access members only boards. If you already have an account with us, then click here to log in.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - WestwegoMan

Pages: 1 [2]
16
Since I installed SMF, the time format has been bugging me. I searched through many threads on the support site with no luck. After a bit of searching again today, I came across a thread about getting rid of the leading zero in the time.

April 05, 2014, 09:13:54 PM

I wanted it to read like this instead.

April 05, 2014, 9:13:54 PM
April 05, 2014, 9:13:54 AM

All of this time it was because I mistook an I for an l. If this bugs you also, you can set the time format to the following in Admin > Features and Options > General

Instead of this:
Code: [Select]
%b %d, %Y, %I:%M %p
Use this to omit the leading zero
Code: [Select]
%b %d, %Y, %l:%M %p

17
SMF Forum tips & tricks / Add header.php
« on: Jan 23, 2015, 5:12 PM »
Add header.php

This will add a header over your SMF forum incase you want to place your main site header above it.

In Themes\default\index.template.php
Find:
Code: [Select]
</head>
<body>';

Add After:
Code: [Select]
include('header.php');
Must add a file named "header.php" in the forum root directory to avoid errors in the forum log.

18
SMF Forum tips & tricks / Add footer.php
« on: Jan 23, 2015, 5:12 PM »
Add footer.php

This will add a separate footer under your SMF forum in case you want to place your main site footer below it.

In Themes\default\index.template.php
Find:
Code: [Select]
// Show the load time?
Add Before:
Code: [Select]
include('footer.php');
Must add a file named "footer.php" in the forum root directory to avoid errors in the forum log.

19
Add what is my ip address to ip links in SMF

Add a link to whatsmyipaddress.com for ip checking.

in Sources\profile-view.php
find:
Code: [Select]
$context['whois_servers'] = array(
add after:
Code: [Select]
'whatisipaddress' => array(
'name' => &$txt['whatis_ipaddress'],
'url' => 'http://whatismyipaddress.com/ip/' . $context['ip'],
'range' => array(),
),

Then in Themes\default\languages\Profile.english.php
find:
Code: [Select]
$txt['whois_title'] = 'Look up IP on a regional whois-server';
And add after:
Code: [Select]
$txt['whatis_ipaddress'] = 'What is my IP address (Whatsmyipaddress.com)';

20
Add more characters to those not allowed in usernames.

This exact edit will make it where only numbers and letters and spaces are allowed.

in ./Sources/Subs-Members.php

Find:
Code: [Select]
// Only these characters are permitted.
if (preg_match('~[<>&"\'=\\\\]~', preg_replace('~&#(?:\\d{1,7}|x[0-9a-fA-F]{1,6});~', '', $regOptions['username'])) != 0 || $regOptions['username'] == '_' || $regOptions['username'] == '|' || strpos($regOptions['username'], '[code') !== false || strpos($regOptions['username'], '[/code') !== false)
$reg_errors[] = array('lang', 'error_invalid_characters_username');

Replace with:
Code: [Select]
// Only these characters are permitted.
if (preg_match('~^[a-zA-Z0-9 ]{1,}$~', $regOptions['username']) == 0 || $regOptions['username'] == '_' || $regOptions['username'] == '|' || strpos($regOptions['username'], '[code') !== false || strpos($regOptions['username'], '[/code') !== false)
$reg_errors[] = array('lang', 'error_invalid_characters_username');

21
Websites etc... / Auto changing copyright code
« on: Jan 23, 2015, 5:09 PM »
HTML:
Code: [Select]
&copy;<?php echo date("Y");?> YourSite.com
PHP:
Code: [Select]
' . date("Y", time()) . '
Java Script
Code: [Select]
<script language="javascript">
var enabled = 0; yeartoday = new Date();
var thisyear;
thisyear = (yeartoday.getFullYear());
document.write("&copy; "+thisyear+" YourSite.com");
</script>

22
MS Excel / Macro to print sheet
« on: Jan 23, 2015, 5:06 PM »
To print a specific sheet

Code: [Select]
Sheets("sheet1").PrintOut
To print active sheet. (copies optional)

Code: [Select]
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Print a sheet depending on value from another sheet.

Code: [Select]
If Sheets("Sheet1").Range("M30").Value = "1" Then Sheets("sheet2").PrintOut

23
MS Excel / Macro to open specific workbook.
« on: Jan 23, 2015, 5:05 PM »
To open a specific workbook using a macro:

Code: [Select]
Workbooks.Open ("C:\path to book\test.xls")

24
MS Excel / Copy from one workbook and paste to another. (VBA)
« on: Jan 23, 2015, 5:04 PM »
To copy from one workbook and paste to another:

Code: [Select]
Windows("workbook1.xls").Activate
Sheets("Sheet4").Select
Range("A1:D10").Select
Selection.Copy
Windows("workbook2.xls").Activate
Sheets("Sheet4").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _

25
MS Excel / Protect and unprotect a sheet. (VBA)
« on: Jan 23, 2015, 5:03 PM »
To protect using a macro:

Code: [Select]
Worksheets("Sheet1").Protect Password:=""Note: you can put a password in the parentheses.

To unprotect:

Code: [Select]
Worksheets("Sheet1").Unprotect Password:=""Note: you can put a password in the parentheses.

26
MS Excel / Save and close a workbook. (VBA)
« on: Jan 23, 2015, 5:02 PM »
Code: [Select]
Sub CloseExcel()
ActiveWorkbook.Save
Application.Quit
End Sub

27
This macro will mark the current time from the PC into cell "I2"

Code: [Select]
Workbooks("Test.xls").Sheets("Main").Cells(2, "I") = Date & "  " & Time

Pages: 1 [2]



The postings on this site are my own and do not necessarily reflect the views of Jefferson Parish,

fellow employees, members of the public, suppliers or people working on behalf of the parish.

WestwegoMan.com Privacy and Disclaimer Statement

Copyright 2015. WestwegoMan.com.