JayBachatero.com

SMF 2.0 Beta 3 Public Released!

The wait is finally over. The first public beta of SMF 2.0 is here!
Simple Machines is extremely proud to announce the long awaited release of the first public beta of SMF 2.0… View the link for the full announcement.

read more | digg story

Share and Enjoy:
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • De.lirio.us
  • blogmarks
  • co.mments
  • feedmelinks
  • NewsVine
  • Reddit
  • TwitThis
  • 1 Comment
  • Filed under: Digg.com
  • For quite some time now, I’ve been trying to use my MDA as a modem for my laptop with Vista, for when I’m not home. Last night I was able to figure it out. It’s pretty easy to do. Your laptop needs to have bluetooth device enabled and paired with the phone. Here are the steps to get this working correctly.
    Read the rest of this entry »

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 2 Comments
  • Filed under: General
  • How to use the SMF user system outside of SMF

    I wrote this article a while back for the doc site.

    Call SSI.php before anything else.
    How do I show a login/logout form?
    How do I redirect users after they login/logout?
    How do I restrict access to certain areas of my pages?
    Extras

    Hooking the SMF user system with external applications is a common issue people have. This document will help explain how to accomplish this. The first thing you will need to do is change the files that you are going to implement this on into php files. So if you have a .html or .htm extension proceding the filename of the file, rename the file with the extension at the end being .php. The reason for this is so that the php content can get parsed as php and not as html. You may ask yourself: By doing this, will it have any effects on my current page? Well the answer is no. Everything will show just the way it did before.
    Read the rest of this entry »

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis

    Java Snippets

    Since I’m back to school and taking my 3rd semester of Java, I’ll have to write lots of small programs. I decided to post them here. Who knows. Maybe they will be useful to some.

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 0 Comments
  • Filed under: Java Snippets
  • New Laptop

    Recently my laptop has been acting up. It’s been getting real hot. The temperature is averaging 65C. So I went ahead and contacted Dell support. Told them the issue and they didn’t ask too much questions. They just asked for address and are going to send me another laptop in a few days. Seems like I’m going to have to install Ubuntu again and struggle getting WiFi to work on it. Last time that I tried to get it to work, it was a mission to do but I was able to get it working.

    Well That’s all for now. I’ll post an update when I get the new one. Maybe I get lucky and it comes with another OS that is not Vista Basic.

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 0 Comments
  • Filed under: General
  • How to recount posts for members in SMF.

    Something that members ask from time to time is for a way to recount the total posts for their member. A while back I wrote a small script to do this. To prevent the script from overloading the server it’s done in small steps. It still needs some work but here it is. Hope it comes in handy to some.

    Recount User Posts File Download

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    
    < ?php
    // Load SSI.php
    require_once('SSI.php');
     
    // Turn this on.
    error_reporting(E_ALL);
     
    // Are we allowed in here?
    isAllowedTo('admin_forum');
     
    $_REQUEST['start'] = !isset($_REQUEST['start']) ? '0' : (int) $_REQUEST['start'];
     
    // Header step and footer.
    show_header();
    // Check if it exists.
    if (!empty($_REQUEST['start']) || (empty($_REQUEST['start']) && isset($_REQUEST['recount'])))
    	recount();
    elseif (isset($_GET['start']) && $_GET['start'] != -1)
    	// Give a link to start
    	echo '
    		<h2><a href="', $_SERVER['PHP_SELF'], '?recount;start=0">Start Post Recount</a>';
    // Footeeerr.
    show_footer();
     
     
    function recount()
    {
    	global $db_prefix;
     
    	while (true)
    	{
    		// Only run this query if we don't have the total.
    		if (!isset($_SESSION['totalMembers']))
    		{
    			$request = db_query("
    				SELECT COUNT(DISTINCT m.ID_MEMBER)
    				FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
    				WHERE m.ID_MEMBER != 0
    					AND b.countPosts = 0
    					AND m.ID_BOARD = b.ID_BOARD", __FILE__, __LINE__);
    			list ($_SESSION['totalMembers']) = mysql_fetch_row($request);
    			mysql_free_result($request);
    			$_SESSION['recountedMembers'] = 0;
    		}
     
    		// Lets get the members and their post counts.
    		// Make sure that we only get boards that have posts count enabled.
    		// !!! On a big board 200 might be a bit to high to count.
    		$request = db_query("
    			SELECT m.ID_MEMBER, COUNT(m.ID_MEMBER) AS posts
    			FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
    			WHERE m.ID_MEMBER != 0
    				AND b.countPosts = 0
    				AND m.ID_BOARD = b.ID_BOARD
    			GROUP BY m.ID_MEMBER
    			LIMIT $_REQUEST[start], 200", __FILE__, __LINE__);
    		$total_rows = mysql_num_rows($request);
    		$_SESSION['recountedMembers'] += $total_rows * 200;
     
    		// Get all the results and assign the correct value.
    		while ($row = mysql_fetch_assoc($request))
    			db_query("
    				UPDATE {$db_prefix}members
    				SET posts = $row[posts]
    				WHERE ID_MEMBER = $row[ID_MEMBER]", __FILE__, __LINE__);
     
    		$_GET['start'] += 200;
    		if ($total_rows < 200)
    			$_GET['start'] = -1;
    		nextStep();
    	}
    }
     
     
    function show_header()
    {
    	global $steps, $timestart;
     
    	if (isset($_SESSION['totalMembers']) && !empty($_GET['start']))
    	{
    		$timestart = time();
    		$total_members = isset($_SESSION['totalMembers']) ? $_SESSION['totalMembers'] : 0;
    		$fake_start = $_GET['start'] + 200 >= $total_members ? $total_members : $_GET['start'] + 2;
    		$percent = round(100 / $total_members * $fake_start, 2);
    	}
     
    	echo '< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    	<head>
    		<title>SMF Member Posts Recount</title>
    		<style type="text/css"><!--
    			body
    			{
    				background-color: #E5E5E5;
    				margin: 0;
    				padding: 0;
    				font-size: 10pt;
    			}
    			#header
    			{
    				font-weight: bold;
    				font-size: 200%;
    			}
    			#content
    			{
    				background-color: #CECED7;
    				border: 1px solid #8B9AAA;
    				padding: 2px;
    			}
    			#footer
    			{
    				font-size: 12px;
    				text-align: right;
    				font-style: italic;
    			}
    			#container
    			{
    				width: 50%;
    				margin: 0 auto 0 auto;
    			}
    			h2
    			{
    				margin: 0;
    				margin-top: 0.5ex;
    				margin-bottom: 0.5ex;
    				padding-bottom: 3px;
    				border-bottom: 1px dashed black;
    				font-size: 14pt;
    				font-weight: normal;
    			}
    			h3
    			{
    				margin: 0;
    				margin-bottom: 2ex;
    				font-size: 10pt;
    				font-weight: normal;
    			}
    			input
    			{
    				margin: 2px;
    			}
    			.status_bar_border
    			{
    				height: 20px;
    				width: 450px;
    				background: #ffffff;
    				border: 1px solid silver;
    				margin: 0 auto 0 auto;
    				padding-right: 4px;
    				text-align: right;
    			}
    			.status_bar
    			{
    				height: 16px;
    				margin: 2px;
    				padding: 0px;
    				text-align: center;
    				text-align: right;
    			}
    			.bg1
    			{
    				background: #3dc0df;
    			}
    			.bg2
    			{
    				background: #C9DDEC;
    			}
    			.percent
    			{
    				text-align: right;
    				color: #000;
    				font-weight: bold;
    				padding-bottom: 5px;
    			}
    			.codebox
    			{
    				background-color: #cccccc;
    				font: normal 10px "Courier New", monospace;
    				border: solid 1px black;
    				padding: 5px;
    				white-space: nowrap;
    				overflow: auto;
    				width: 95%;
    			}
    		--></style>
    	</head>
    	<body>
    		<div id="container">
    			<div id="header">
    				SMF Member Posts Recount
    			</div>
    			<div id="content">';
     
    	if (!empty($total_members))
    		echo '
    				<h2>Recount Status</h2>
    				<h3 style="margin: 0 0 0 40px; font-weight: bold;">Overall Process</h3>
    				<div class="status_bar_border">
    					<div class="status_bar bg1" style="width: ', $percent, '%; white-space: nowrap;">', $percent, '% (', $fake_start, ' out of ', $total_members, ' members) </div>
    				</div>';
     
    	if (isset($percent) && $percent == 100 || isset($_GET['start']) && $_GET['start'] == -1)
    		echo '
    				<h1>Recount Complete</h1>';
     
    }
     
    function show_footer()
    {
    	echo '
    			</div>
    			<div id="footer">
    				<a href="http://jaybachatero.com">JayBachatero.com</a>
    			</div>
    		</div>
    	</body>
    </html>';
    }
     
    function nextStep($step = null)
    {
    	global $timestart;
     
    	@set_time_limit(300);
    	if (function_exists('apache_reset_timeout'))
    		apache_reset_timeout();
     
    	echo '
    				<h2 style="margin-top: 2ex;">Recount Paused!</h2>
    				<h3>This recount has paused to avoid server overload.</h3>
     
    				<form action="', $_SERVER['PHP_SELF'], '?start=', $_GET['start'], '" method="post" name="auto_submit">
    					<div align="right" style="margin: 1ex;"><input name="timer" type="submit" value="Continue" /></div>
    				</form>
    				<script language="JavaScript" type="text/javascript"><!-- // -->< ![CDATA[
    					window.onload = autoSubmit;
    					var countdown = 3;
     
    					function autoSubmit()
    					{
    						if (countdown == 0)
    							document.auto_submit.submit();
    						else if (countdown == -1)
    							return;
     
    						document.auto_submit.timer.value = "Continue (" + countdown + ")";
    						countdown--;
     
    						setTimeout("autoSubmit();", 1000);
    					}
    				// ]]></script>';
     
    	show_footer();
    	exit;
    }
    ? >
    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis

    Simple Machines Forum Releases SMF 2.0 Beta 2

    Simple Machines Forum is pleased to announce that the second beta of SMF 2.0. This release includes many new features such as
    *Added paid subscription feature
    *Added search engine tracking
    *Numerous improvements to the WYSIWYG editor
    -Click article to read more about the feature updates.

    read more | digg story

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 1 Comment
  • Filed under: Digg.com, SMF Stuff
  • I got tired of having to press tab each time when I enter my SS number in the Unemployment Insurance Benefits Online website so I made this GreaseMonkey script. I’m not so good in JS but it gets the job done. I’m pretty sure it can be written better.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    
    // ==UserScript==
    // @name           Unemployment Insurance Benefits Online by JayBachatero
    // @namespace      http://www.jaybachatero.com
    // @description    Go to next field when entering ssn.
    // @include        https://ui.labor.state.ny.us/UBC/home.do
    // @version        1.0
    // ==/UserScript==
     
    // The name of the fields we are going to look for.
    var ssn_fields = new Array(
    	['ILoginForm.SSN1_KEY', 3],
    	['ILoginForm.SSN2_KEY', 2],
    	['ILoginForm.SSN3_KEY', 4]
    );
    // Current field.
    var current_field = 0;
     
    function goToNextField()
    {
    	// Stop right there.
    	if (current_field > 2)
    		return;
     
    	// Field properties.
    	var id = ssn_fields[current_field][0];
    	var field_properties = document.getElementById(id);
    	// Current value.
    	var current_value = field_properties.value.length;
    	// Check the current field.
    	if (current_value == ssn_fields[current_field][1])
    	{
    		// Increase the current_field
    		current_field = current_field >= 2 ? 2 : current_field + 1;
    		// Move to the next field.
    		document.getElementById(ssn_fields[current_field][0]).focus();
    	}
     
    	// Only if the current field is not the last one.
    	setTimeout(goToNextField, 500);
    }
     
    // Start it.
    setTimeout(goToNextField, 1000);
    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 0 Comments
  • Filed under: PHP Snippets
  • Where have I been?

    Wow it’s been a while since I write here. A lot has happened in the past few months. I started my first semester in college in January. It went ok I guess. I’m majoring in Computer Programming. I also got myself a laptop. I got a Dell Inspiron 1501. It’s pretty good.

    The only and best thing that happened since my last post was that I went on vacation to D.R. (Dominican Republic) after having three years w/o going. I enjoyed my self out there. It was great. Lots of drinking and what not. I didn’t even want to come back.

    (Un)fortunately With my trip to D.R. I became less attached to the PC. Seems like I’ve lost lots of interest in Programming and PC related stuff. One of the biggest things that I’ve lost interest is in SMF. As some of you may have noticed I barely post there. All I do is lurk from time to time. I myself don’t know the exact reasons for the lost of interest. There are many factors affecting me there ATM. I’m still trying to decide what to do. Also my current job is taking a lot of time away from me so that is affecting me as well as far as being on online and so on. I come home too tired to code. So this has me looking for a new job. I’m trying to find a job that’s programming related. The current one is not even remotely close to it.

    I started working on rewriting BuyTickets123.com. I’m slowly working on that as well but since there is no motivation its taking me longer than usual to get things done.

    Well thats it for now I guess. I’m just trying to get myself back together and get that motivation and time to do what I once loved and enjoyed doing…

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 2 Comments
  • Filed under: General
  • Introducing SMF 2.0

    Simple Machines is proud to announce that the next version of SMF will be version 2.0 – in recognition of the scale of the changes implemented since SMF 1.1. As well as adding new features such as a WYSIWYG editor and custom profile fields, SMF 2.0 makes considerable changes “under the hood” with improved caching and database abstraction….

    read more | digg story

    Share and Enjoy:
    • Digg
    • Facebook
    • MySpace
    • del.icio.us
    • De.lirio.us
    • blogmarks
    • co.mments
    • feedmelinks
    • NewsVine
    • Reddit
    • TwitThis
  • 1 Comment
  • Filed under: Digg.com
  • PhotoStream

      200812191431542008121918500420081219185202200812191852162008121918523620081219185255

    Latest Photos

    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field
    Citi Field

    Calendar

    September 2010
    S M T W T F S
    « May    
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  

    Google Ads