Skip to content

Instantly share code, notes, and snippets.

@jpustula
jpustula / phpbb3_topics_anywhere.php
Last active September 4, 2015 23:34
Display list of last topics from phpBB3 forum wherever you want!
<?php
/**
* phpBB3 Topics Anywhere
*
* Display list of last topics from phpBB3 forum wherever you want!
*
* @author Jarosław Pustuła <kontakt@weeb.pl>
* @license http://www.gnu.org/licenses/gpl.html
*/
<script type="text/javascript">
// <![CDATA[
function hide_qr(show)
{
dE('qr_editor_div');
dE('qr_showeditor_div');
if (show && document.getElementById('qr_editor_div').style.display != 'none')
{
document.getElementsByName('message')[0].focus();
}
@jpustula
jpustula / converter.php
Created August 27, 2010 15:56
Convert phpBB3's database and tables to Unicode
<?php
/**
* Convert phpBB3's database and tables to Unicode
*
* @author Jarosław Pustuła <kontakt@weeb.pl>
* @license http://www.gnu.org/licenses/gpl.html
*/
/*$dbms = '';
<!-- BEGIN forumrow -->
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW or forumrow.S_NO_CAT -->
@jpustula
jpustula / gist:1136739
Created August 10, 2011 12:57
Count unread post for phpBB 3.0.9 (file includes/functions.php)
// Count posts since last vivist
if ($user->data['is_registered'] && $config['load_search'] && $auth->acl_get('u_search') && $auth->acl_getf_global('f_search'))
{
/*$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
@jpustula
jpustula / page_title.module.patch
Created August 1, 2012 19:10
Changes in Page Tile 2.7 module for Drupal 7. Repairs pager suffix pattern.
--- old/page_title.module 2012-05-09 11:28:00.000000000 +0200
+++ new/page_title.module 2012-08-01 20:43:49.032958200 +0200
@@ -601,19 +601,23 @@
if (is_null($title)) {
$types = array('global' => NULL);
-
+ $status = drupal_get_http_header("status");
+
// Allow hook_page_title_pattern_alter() to modify the pattern and tokens
@jpustula
jpustula / tablefield.module.patch
Created August 16, 2012 09:42
Changes in Tablefield 2.0 module (Drupal 7.15) for ap-serwis.pl. Remove table header styles and add colon to text in first column.
*** tablefield.module 2012-01-13 13:28:18.000000000 -0800
--- tablefield.module 2012-08-16 02:34:37.029457200 -0700
***************
*** 186,194 ****
--- 186,198 ----
foreach ($tabledata as $row_key => $row) {
foreach ($row as $col_key => $cell) {
if (!empty($table['format'])) {
+ // Add colon after name in first table column
+ $cell = ($col_key == 0) ? $cell . ':' : $cell;
/**
* Implementacja funkcji pi(n).
* Oblicza liczbę liczb pierwszych z zadanego przedziału
*
* @param int n Liczba naturalna
*/
public static int pi(int n) {
/**
* Liczba liczb pierwszych z zadanego przedziału.
* Wartość początkowa pochodzi z zadanego wzoru.
[Część 1]
2. True
4.
DESCRIBE hr.departments;
SELECT * FROM hr.departments;
5.
DESCRIBE hr.EMPLOYEES;
SELECT EMPLOYEE_ID, last_name, job_id, hire_date
@jpustula
jpustula / messages.json
Created May 2, 2013 14:43
Rozpoczęte spolszczenie rozszerzenia Speed Dial 2 dla Google Chrome.
{
"add": {
"message": "Add"
},
"alignment": {
"message": "Alignment"
},
"appDesc": {
"description": "App description.",
"message": "Speed dial 2 is fast and clean extension for your favorite pages and quick access to your apps, bookmarks and browsing history."