Skip to content

Instantly share code, notes, and snippets.

function page_title_error()
{
$favorite=@$this->content['favorite'];
if (isset($favorite))
$this->output('<form '.$favorite['form_tags'].'>');
echo 'Template: ' . $this->template . ' ';
switch ($this->template) {
case 'qa':
<?php
public function initialize()
{
parent::initialize();
$this->displayUserTitleInProfileSectionTitle();
}
private function displayUserTitleInProfileSectionTitle()
{
if ($this->template !== 'user') {
return;
<?php
/*
Snow Theme for Question2Answer Package
Copyright (C) 2014 Q2A Market <http://www.q2amarket.com>
File: qa-theme.php
Version: Snow 1.4
Description: Q2A theme class
This program is free software: you can redistribute it and/or modify
@pupi1985
pupi1985 / refactoring.js
Last active November 18, 2016 17:21
refactoring.js
(() => {
var refactoring = () => {
var node = document.createTextNode("Refactored!");
var body = document.getElementsByTagName("BODY")[0];
if (body.hasChildNodes()) {
body.insertBefore(node, body.firstChild);
} else {
body.appendChild(node);
}
};
@pupi1985
pupi1985 / qa-badge-page.php
Created January 14, 2017 16:35
Badge's page fix for SnowFlat
function process_request($request)
{
$qa_content=qa_content_prepare();
$qa_content['title']=qa_lang('badges/badge_list_title');
$badges = qa_get_badge_list();
$totalawarded = 0;
@pupi1985
pupi1985 / youtube-refactoring.js
Last active August 5, 2017 19:56
youtube-refactoring.js
document.addEventListener("readystatechange", function (event) {
// Unable to use jQuery here
if (document.readyState == "complete") {
var page = document.getElementById("page");
if (!page) {
return;
}
var performChanges = () => {
var videoTitleSpan = document.getElementById("eow-title");
@pupi1985
pupi1985 / qa-wysiwyg-upload.php
Created September 6, 2021 15:47
Improved image upload
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-plugin/wysiwyg-editor/qa-wysiwyg-upload.php
Description: Page module class for WYSIWYG editor (CKEditor) file upload receiver
This program is free software; you can redistribute it and/or