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
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)';

17
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');

18
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>

19
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

20
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")

21
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:= _

22
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.

23
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

24
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.