wmaraci reklam

Kodlarda değişiklik yapmam gerekiyor

14 Mesajlar 1.587 Okunma
wmaraci reklam

RadiKaL RadiKaL WM Aracı Kullanıcı
  • Üyelik 08.12.2013
  • Yaş/Cinsiyet 39 / E
  • Meslek Çiftçi
  • Konum Bursa
  • Ad Soyad A** G**
  • Mesajlar 1304
  • Beğeniler 281 / 398
  • Ticaret 8, (%100)
Yapımcı kodlarda değişiklik yapmamı istedi ama beceremedim. Bana değişiklikleri yapar mısınız.

UPDATE 2: for the missing name problem, change the following lines. In qa-theme-base.php in the body_content function change the qa-body-wrapper line to this:

$extratags = isset($this->content['main_tags']) ? $this->content['main_tags'] : '';
$this->output('
', '');

Then in the main() function remove the line starting $extratags = then change the next line to:

$this->output('
');

Özellikle bu ikinciyi hiç anlamadım. Birinciyi yaptım sanırım.

Değişiklik yapılacak dosya

/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/

Description: Default theme class, broken into lots of little functions for easy overriding


This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

More about this license: http://www.question2answer.org/license.php
*/

if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}


/*
How do I make a theme which goes beyond CSS to actually modify the HTML output?

Create a file named qa-theme.php in your new theme directory which defines a class qa_html_theme
that extends this base class qa_html_theme_base. You can then override any of the methods below,
referring back to the default method using double colon (qa_html_theme_base::) notation.

Plugins can also do something similar by using a layer. For more information and to see some example
code, please consult the online Q2A documentation.
*/

class qa_html_theme_base
{
public $template;
public $content;
public $rooturl;
public $request;
public $isRTL; // (boolean) whether text direction is Right-To-Left

protected $minifyHtml; // (boolean) whether to indent the HTML
protected $indent = 0;
protected $lines = 0;
protected $context = array();

// whether to use new block layout in rankings (true) or fall back to tables (false)
protected $ranking_block_layout = false;
// theme 'slug' to use as CSS class
protected $theme;


/**
* Initialize the object and assign local variables.
* @param $template
* @param $content
* @param $rooturl
* @param $request
*/
public function __construct($template, $content, $rooturl, $request)
{
$this->template = $template;
$this->content = $content;
$this->rooturl = $rooturl;
$this->request = $request;
$this->isRTL = isset($content['direction']) && $content['direction'] === 'rtl';
$this->minifyHtml = !empty($content['options']['minify_html']);
}

/**
* @deprecated PHP4-style constructor deprecated from 1.7; please use proper `__construct`
* function instead.
* @param $template
* @param $content
* @param $rooturl
* @param $request
*/
public function qa_html_theme_base($template, $content, $rooturl, $request)
{
self::__construct($template, $content, $rooturl, $request);
}


/**
* Output each element in $elements on a separate line, with automatic HTML indenting.
* This should be passed markup which uses the form for unpaired tags, to help keep
* track of indenting, although its actual output converts these to for W3C validation.
* @param $elements
*/
public function output_array($elements)
{
foreach ($elements as $element) {
$line = str_replace('/>', '>', $element);

if ($this->minifyHtml) {
if (strlen($line))
echo $line . "\n";
} else {
$delta = substr_count($element, '<') - substr_count($element, '');

if ($delta < 0) {
$this->indent += $delta;
}

echo str_repeat("\t", max(0, $this->indent)) . $line . "\n";

if ($delta > 0) {
$this->indent += $delta;
}
}

$this->lines++;
}
}


/**
* Output each passed parameter on a separate line - see output_array() comments.
*/
public function output() // other parameters picked up via func_get_args()
{
$args = func_get_args();
$this->output_array($args);
}


/**
* Output $html at the current indent level, but don't change indent level based on the markup within.
* Useful for user-entered HTML which is unlikely to follow the rules we need to track indenting.
* @param $html
*/
public function output_raw($html)
{
if (strlen($html))
echo str_repeat("\t", max(0, $this->indent)) . $html . "\n";
}


/**
* Output the three elements ['prefix'], ['data'] and ['suffix'] of $parts (if they're defined),
* with appropriate CSS classes based on $class, using $outertag and $innertag in the markup.
* @param $parts
* @param $class
* @param string $outertag
* @param string $innertag
* @param string $extraclass
*/
public function output_split($parts, $class, $outertag = 'span', $innertag = 'span', $extraclass = null)
{
if (empty($parts) && strtolower($outertag) != 'td')
return;

$this->output(
'<' . $outertag . ' class="' . $class . (isset($extraclass) ? (' ' . $extraclass) : '') . '">',
(strlen(@$parts['prefix']) ? ('<' . $innertag . ' class="' . $class . '-pad">' . $parts['prefix'] . '') : '') .
(strlen(@$parts['data']) ? ('<' . $innertag . ' class="' . $class . '-data">' . $parts['data'] . '') : '') .
(strlen(@$parts['suffix']) ? ('<' . $innertag . ' class="' . $class . '-pad">' . $parts['suffix'] . '') : ''),
''
);
}


/**
* Set some context, which be accessed via $this->context for a function to know where it's being used on the page.
* @param $key
* @param $value
*/
public function set_context($key, $value)
{
$this->context[$key] = $value;
}


/**
* Clear some context (used at the end of the appropriate loop).
* @param $key
*/
public function clear_context($key)
{
unset($this->context[$key]);
}


/**
* Reorder the parts of the page according to the $parts array which contains part keys in their new order. Call this
* before main_parts(). See the docs for qa_array_reorder() in util/sort.php for the other parameters.
* @param $parts
* @param string $beforekey
* @param bool $reorderrelative
*/
public function reorder_parts($parts, $beforekey = null, $reorderrelative = true)
{
require_once QA_INCLUDE_DIR . 'util/sort.php';

qa_array_reorder($this->content, $parts, $beforekey, $reorderrelative);
}


/**
* Output the widgets (as provided in $this->content['widgets']) for $region and $place.
* @param $region
* @param $place
*/
public function widgets($region, $place)
{
$widgetsHere = isset($this->content['widgets'][$region][$place]) ? $this->content['widgets'][$region][$place] : array();
if (is_array($widgetsHere) && count($widgetsHere) > 0) {
$this->output('
');

foreach ($widgetsHere as $module) {
$this->output('
');
$module->output_widget($region, $place, $this, $this->template, $this->request, $this->content);
$this->output('
');
}

$this->output('
', '');
}
}

/**
* Pre-output initialization. Immediately called after loading of the module. Content and template variables are
* already setup at this point. Useful to perform layer initialization in the earliest and safest stage possible.
*/
public function initialize()
{
// abstract method
}

/**
* Post-output cleanup. For now, check that the indenting ended right, and if not, output a warning in an HTML comment.
*/
public function finish()
{
if ($this->indent !== 0 && !$this->minifyHtml) {
echo "\n";
}
}


// From here on, we have a large number of class methods which output particular pieces of HTML markup
// The calling chain is initiated from qa-page.php, or ajax/*.php for refreshing parts of a page,
// For most HTML elements, the name of the function is similar to the element's CSS class, for example:
// search() outputs
SMM Panel, Sosyalyuvam, Bayilik Paneli, En Uygun Panel, Takipçi Paneli
reklam

MyYafes MyYafes Developer Kullanıcı
  • Üyelik 05.03.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Full-Stack Web Developer
  • Konum Ankara
  • Ad Soyad M** M**
  • Mesajlar 25
  • Beğeniler 0 / 7
  • Ticaret 0, (%0)

public function main()
{
$content = $this->content;
$hidden = !empty($content['hidden']) ? ' qa-main-hidden' : '';
$extratags = isset($this->content['main_tags']) ? $this->content['main_tags'] : '';

$this->output('
');

$this->widgets('main', 'top');

$this->page_title_error();

$this->widgets('main', 'high');

$this->main_parts($content);

$this->widgets('main', 'low');

$this->page_links();
$this->suggest_next();

$this->widgets('main', 'bottom');

$this->output('
', '');
}


Hocam istenilen değişiklik şu şekilde: Dosyadaki public main() foknsyonunuzu komple silip yukarıda yazdığım public main() fonksyon kodu ile değiştirin.
 

 

RadiKaL RadiKaL WM Aracı Kullanıcı
  • Üyelik 08.12.2013
  • Yaş/Cinsiyet 39 / E
  • Meslek Çiftçi
  • Konum Bursa
  • Ad Soyad A** G**
  • Mesajlar 1304
  • Beğeniler 281 / 398
  • Ticaret 8, (%100)
MyYafes teşekkür ederim. Sonunda değişikliği yapabildim. Galiba kör oldum pc başında :)
 

 

MyYafes MyYafes Developer Kullanıcı
  • Üyelik 05.03.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Full-Stack Web Developer
  • Konum Ankara
  • Ad Soyad M** M**
  • Mesajlar 25
  • Beğeniler 0 / 7
  • Ticaret 0, (%0)
Rica ederim. İyi çalışmalar, :) Ayrıca iyi bir şeyler başarmak için bedeller ödeyebiliriz. ;)
RadiKaL

kişi bu mesajı beğendi.

wmaraci

RadiKaL RadiKaL WM Aracı Kullanıcı
  • Üyelik 08.12.2013
  • Yaş/Cinsiyet 39 / E
  • Meslek Çiftçi
  • Konum Bursa
  • Ad Soyad A** G**
  • Mesajlar 1304
  • Beğeniler 281 / 398
  • Ticaret 8, (%100)
MyYafes adam bana böyle birşey dedi.

Güncelleme 2' bölümünü henüz yapmadınız. "$ Extratags", "qa-body-wrapper" öğesi değil "qa-main" öğesi üzerinde hala çıkış ediliyor.

Değişikliği doğru yapmadık sanırım. Var mı bir fikrin

@[ÖmerGünay](userid:49611) seninde fikirlerini bekliyorum bootstrap işimi yapmadın ama :)
 

 

OmerGunay OmerGunay https://omergunay.net Kullanıcı
  • Üyelik 15.05.2015
  • Yaş/Cinsiyet 33 / E
  • Meslek PHP Developer
  • Konum İstanbul Avrupa
  • Ad Soyad Ö** G**
  • Mesajlar 1206
  • Beğeniler 374 / 380
  • Ticaret 16, (%100)
RadiKaL bootstrap işinde bişey demedin ki. Bu konudaki soruna gelirsem bu scripti bilmiyorum o yüzden bişey diyemedim. Bir de ingilizcelerden bişey anlamadım ne istiyor adam.
 

 

Herkes yediğinden ikram eder..(Yavuz Sultan Selim)

RadiKaL RadiKaL WM Aracı Kullanıcı
  • Üyelik 08.12.2013
  • Yaş/Cinsiyet 39 / E
  • Meslek Çiftçi
  • Konum Bursa
  • Ad Soyad A** G**
  • Mesajlar 1304
  • Beğeniler 281 / 398
  • Ticaret 8, (%100)
Şunu şununla değiştir falan diyor. Birşey anlamadım açıkcası yapısal veri hatası alıyorum çözemiyorum bir türlü. pm atıyorum
 

 

MyYafes MyYafes Developer Kullanıcı
  • Üyelik 05.03.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Full-Stack Web Developer
  • Konum Ankara
  • Ad Soyad M** M**
  • Mesajlar 25
  • Beğeniler 0 / 7
  • Ticaret 0, (%0)
İkinci değişikliğini yaptık doğru anladığıma eminim ama istersen güncel olarak sor bir cevabını tamamını buraya yaz.
 

 

RadiKaL RadiKaL WM Aracı Kullanıcı
  • Üyelik 08.12.2013
  • Yaş/Cinsiyet 39 / E
  • Meslek Çiftçi
  • Konum Bursa
  • Ad Soyad A** G**
  • Mesajlar 1304
  • Beğeniler 281 / 398
  • Ticaret 8, (%100)
MyYafes sanırım ben birinci değişikliği yanlış yapıyorum. Dediği şu

You haven't done the 'update 2' part. The "$extratags" are still being output on the "qa-main" element, not the "qa-body-wrapper" element.
 

 

MyYafes MyYafes Developer Kullanıcı
  • Üyelik 05.03.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Full-Stack Web Developer
  • Konum Ankara
  • Ad Soyad M** M**
  • Mesajlar 25
  • Beğeniler 0 / 7
  • Ticaret 0, (%0)
qa-theme-base.php dosyasının kodlarını paylaşır mısın?
 

 

wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)