Advertisement:

Author Topic: Trikovi za poboljsanje vaseg foruma  (Read 103111 times)

Offline Bob Marley

  • Full Member
  • ***
  • Posts: 677
  • Gender: Male
  • n008
    • KSFB
Re: Trikovi za poboljsanje vaseg foruma
« Reply #120 on: June 21, 2010, 10:28:17 AM »
Pa to je to covece... " // Show information about the poster of this message." lol

Offline Madzgo

  • Sophist Member
  • *****
  • Posts: 1,070
    • Urban Themes
Re: Trikovi za poboljsanje vaseg foruma
« Reply #121 on: June 21, 2010, 11:40:53 AM »
da ali uporedi moj kod i tvoj kod...
kad stavim tvoj kod iskoci mi eror

LOL!!!

Offline Bob Marley

  • Full Member
  • ***
  • Posts: 677
  • Gender: Male
  • n008
    • KSFB
Re: Trikovi za poboljsanje vaseg foruma
« Reply #122 on: June 21, 2010, 12:43:46 PM »
Pa covece... Nemoj biti bukvalista :D Poenta je bila i dalje je krajnje jednostavna zamenis left sa center :D omg :D

Offline Madzgo

  • Sophist Member
  • *****
  • Posts: 1,070
    • Urban Themes
Re: Trikovi za poboljsanje vaseg foruma
« Reply #123 on: June 21, 2010, 01:06:40 PM »
pa krajnje jednostavno nije uopste nidje bilo align="left" tako da se nije moglo zamijenit... aj da si rekao dodaj pa ajde.. nego sam nervozan, zamalo nagrdih forum, uh.. :)

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #124 on: June 22, 2010, 06:06:15 AM »
Unapred ispisan text u postu.

Je li to radi na SMF- u 2.0 RC3?
« Last Edit: August 19, 2010, 05:11:00 AM by Masterd »

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #125 on: June 23, 2010, 09:16:15 AM »
Postavio sam pitanje u originalnoj Antechinusovoj temi, ali mi nitko ne odgovara, pa ću okušati sreću ovdje. Imam problem sa zaobljenim citatima. Također me zanima kako maknuti ovaj slide bar s desne strane.


Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #126 on: June 24, 2010, 08:40:58 AM »
                           
Dodavanje novih post ikona


SMF 1.1.x

Sources/Post.php

Pronađite:

Code: [Select]
$context['icons']

Trebali biste vidjeti ovo:

Code: [Select]
   $context['icons'] = array(
      array('value' => 'xx', 'name' => $txt[281]),
      array('value' => 'thumbup', 'name' => $txt[282]),
      array('value' => 'thumbdown', 'name' => $txt[283]),
      array('value' => 'exclamation', 'name' => $txt[284]),
      array('value' => 'question', 'name' => $txt[285]),
      array('value' => 'lamp', 'name' => $txt[286]),
      array('value' => 'smiley', 'name' => $txt[287]),
      array('value' => 'angry', 'name' => $txt[288]),
      array('value' => 'cheesy', 'name' => $txt[289]),
      array('value' => 'grin', 'name' => $txt[293]),
      array('value' => 'sad', 'name' => $txt[291]),
      array('value' => 'wink', 'name' => $txt[292])
   );


Novi kod bi trebao izgledati ovako:

Code: [Select]
   $context['icons'] = array(
      array('value' => 'xx', 'name' => $txt[281]),
      array('value' => 'thumbup', 'name' => $txt[282]),
      array('value' => 'thumbdown', 'name' => $txt[283]),
      array('value' => 'exclamation', 'name' => $txt[284]),
      array('value' => 'question', 'name' => $txt[285]),
      array('value' => 'lamp', 'name' => $txt[286]),
      array('value' => 'smiley', 'name' => $txt[287]),
      array('value' => 'angry', 'name' => $txt[288]),
      array('value' => 'cheesy', 'name' => $txt[289]),
      array('value' => 'grin', 'name' => $txt[293]),
      array('value' => 'sad', 'name' => $txt[291]),
      array('value' => 'wink', 'name' => $txt[292]),
      array('value' => 'novaikona', 'name' => 'Nova ikona),
      array('value' => 'novaikona1', 'name' => $txt['novaikona1'])
   );


Sada samo uploadajte gif sliku u Themes/vaša tema/images/post


Offline rocknroller

  • SMF Hero
  • ******
  • Posts: 1,594
  • Gender: Male
  • Justice has been served!
Re: Trikovi za poboljsanje vaseg foruma
« Reply #127 on: July 02, 2010, 12:05:18 PM »
Aktivne teme Smf 2.0 RC 2 + oglasi


Radi se o proširenoj obogaćenoj ssi funkciji recentTopics sa mogućim dodavanjem google okomitih oglasa.  Dodana na stranicu Portala.

U rootu foruma datoteka SSI.php pronađite
Code: [Select]
?> i dodajte iznad
Code: [Select]
// Recent topic list:   Proširena verzija By rocknroller
function ssi_recentTopicsrocknroller($num_recent = 100, $exclude_boards = null, $include_boards = null, $output_method = 'echo')
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));

// Only some boards?.
if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method = $include_boards;
$include_boards = array();
}

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
WHERE t.id_last_msg >= {int:min_message_id}
' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
' . (empty($include_boards) ? '' : '
AND b.id_board IN ({array_int:include_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND m.approved = {int:is_approved}' : '') . '
ORDER BY t.id_last_msg DESC
LIMIT ' . $num_recent,
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' : $include_boards,
'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards,
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'is_approved' => 1,
)
);
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['board_name'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'replies' => $row['num_replies'],
'views' => $row['num_views'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}
$smcFunc['db_free_result']($request);

// Just return it.
if ($output_method != 'echo' || empty($posts))
return $posts;

echo '
<div ><h3 class="catbg" align="center"><strong>Aktivne teme:</strong></h3></div>
<hr />
<div class="adds"></div><table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '

<tr>
<td class="aktivneteme" align="left" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td class="aktivneteme">
', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '
</td>
<td class="aktivneteme" valign="top">

<a href="', $post['href'], '">', $post['subject'], '</a>

</td>
<td class="aktivneteme">
[&nbsp;', $txt['by'], ' ', $post['poster']['link'], '&nbsp;]&nbsp;
</td>

<td class="aktivneteme" align="left" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>

';
}


U CSS datoteku predloška ...tema/css/index.css
na dno dodajte:
Code: [Select]
/*Aktivne teme*/
.aktivneteme
{
margin: 0px;
padding: 2px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 1px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: solid;
border-left-style: none;
border-top-color: #ccc;
border-right-color: #ccc;
border-bottom-color: #ccc;
border-left-color: #ccc;
color: black;
}

.ssi_table
{
margin: 0px;
padding: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
}
.adds
{
margin: 0px;
padding: 0px;
float: right;
}
/*Aktivne teme kraj*/

Za dodavanje oglasa  pronađite gore u kodu
Code: [Select]
<div class="adds"></div>i dodajte kod oglasa između div tagova ovako:
Code: [Select]
<div class="adds">OVDIJE DODAJTE KOD OGLASA</div>

Napravite stranicu na portalu, označite ju za PHP i unutra dodajte
Code: [Select]
<?php ssi_recentTopicsrocknroller(); ?>
link od stranice postavite gdje vam odgovara na forumu.
« Last Edit: July 09, 2010, 09:21:15 AM by rocknroller »

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #128 on: August 02, 2010, 03:15:03 PM »
                                     
Prateći/leteći quick reply box


Samo za SMF 2.0 RC4 i novije verzije!

Prvo dodajte ovo u index.css:

Code: [Select]
#quickreplybox {
bottom:10px;
left:-10px;
display:block;
max-width:900px;
position:fixed;
width:350px;
z-index:1000;
}

Display.template.php:

Pronađite:

Code: [Select]
   if ($context['can_reply'] && !empty($options['display_quick_reply']))
   {


Dodajte poslije:

Code: [Select]
      echo '
<script type="text/javascript" src="', $settings['theme_url'], '/scripts/jquery-1.4.2.min.js" ></script>
<script type="text/javascript">
  $(document).ready(function() {
 
     //have the quick reply box expand on focus
   $("#quickreplybox textarea").focus(function() {
      $("#quickreplybox").animate({
      width: "900px"
     }, 500);
   });

   // be sure to know when the mouse is over the quick reply box (we will need it soon)
   var mouse_is_inside = false;
    $("#quickreplybox").hover(function(){
        mouse_is_inside=true;
    }, function(){
        mouse_is_inside=false;
    });

   // if the mouse is clicked somewhere OUTSIDE the reply box, fold it back
    $(document).mouseup(function(){
      if(! mouse_is_inside) {
      $("#quickreplybox").animate({
         width: "350px"
         }, 500);
         };
    });
   
  });
</script>';


Zatim napravite file jquery-1.4.2.min.js ovog sadržaja i spremite ga u scripts direktorij Vaše teme.

Upozorenje: Ako kliknete na površinu izvan quick reply boxa, on će se zatvoriti, ali to neće biti moguće ako koristite ovaj mod.
« Last Edit: December 14, 2010, 05:02:55 PM by Masterd »

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male

Offline Madzgo

  • Sophist Member
  • *****
  • Posts: 1,070
    • Urban Themes
Re: Trikovi za poboljsanje vaseg foruma
« Reply #130 on: December 14, 2010, 09:27:41 AM »
Kako dodati favicon ikonicu?



Index,template.php
Code: [Select]
<title>', $context['page_title'], '</title>';Zamenite sa:
Code: [Select]
<title>', $context['page_title'], '</title>';

echo '<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />';
echo '<link rel="icon" href="/favicon.ico" type="image/x-icon" />';

Napravite ikonicu favicon.ico. Ikonica mora biti formata 16 x 16 i upoadujte se u root vaseg sajta / foruma.


Drugi nacin
Favicon Mod
Add favicon support


A u koji fajl se nalazi ovo u RC4?

Offline Dzonny

  • Local Moderator
  • SMF Super Hero
  • *
  • Posts: 11,789
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Trikovi za poboljsanje vaseg foruma
« Reply #131 on: December 14, 2010, 10:21:07 AM »
Takodje, index.template.php

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #132 on: December 14, 2010, 05:02:17 PM »
Server bi inače trebao sam prepoznati favicon.ico file bez ikakvih modifikacija.

Offline scrolllock

  • Jr. Member
  • **
  • Posts: 207
    • Balkan Forum
Re: Trikovi za poboljsanje vaseg foruma
« Reply #133 on: December 22, 2010, 07:56:02 PM »
U vezi img taga meni i dalje trazi da link od slike stavljam u img tag iako sam zamenio sve kako si objasnio, u cemu je problem?

Offline Dzonny

  • Local Moderator
  • SMF Super Hero
  • *
  • Posts: 11,789
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Trikovi za poboljsanje vaseg foruma
« Reply #134 on: December 23, 2010, 03:51:17 AM »
Koja je verzija foruma?
Priloži Subs.php da pogledam.

Offline scrolllock

  • Jr. Member
  • **
  • Posts: 207
    • Balkan Forum
Re: Trikovi za poboljsanje vaseg foruma
« Reply #135 on: December 23, 2010, 05:12:12 AM »
Verzija 1.1.12

evo dela gde sam zamenio i par linija pre i posle

Code: [Select]
// Close any remaining tags.
while ($tag = array_pop($open_tags))
$message .= $tag['after'];

if (substr($message, 0, 1) == ' ')
$message = '&nbsp;' . substr($message, 1);

if (strpos($message, '<a href') !== false )
{
    //show up images without inserting them between [img] tags ;)
$message = preg_replace('~<a href="(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))"(.*?)>(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))</a>~i', '<img src="$1$2" alt="" />', $message);
}

if (strpos($message, '<a href') !== false )
{
    //show up images without inserting them between [img] tags ;)
$message = preg_replace('~<a href="(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))"(.*?)>(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))</a>~i', '<img src="$1$2" alt="" />', $message);
}

Offline Dzonny

  • Local Moderator
  • SMF Super Hero
  • *
  • Posts: 11,789
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Trikovi za poboljsanje vaseg foruma
« Reply #136 on: December 23, 2010, 06:14:51 PM »
Možeš li mi reći koji si link ostavio, a da se nije prikazala slika? Da li imaš nešto u error logu?

Offline scrolllock

  • Jr. Member
  • **
  • Posts: 207
    • Balkan Forum
Re: Trikovi za poboljsanje vaseg foruma
« Reply #137 on: December 24, 2010, 04:20:40 AM »
U error logu nemam nista a ako mislis na link od slike postavljao sam razlicite i sa razlicitih hostinga ali ne prikazuje.

Offline Dzonny

  • Local Moderator
  • SMF Super Hero
  • *
  • Posts: 11,789
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: Trikovi za poboljsanje vaseg foruma
« Reply #138 on: December 24, 2010, 05:43:59 AM »
Aha, nadam se da si pokušao sa različitim ekstenzijama, pošto nisu sve dozvoljene.
Daj mi samo malo vremena da testiram, možda je nešto promenjeno u novoj verziji smfa, pa ne radi.

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,895
  • Gender: Male
Re: Trikovi za poboljsanje vaseg foruma
« Reply #139 on: January 04, 2011, 08:07:32 AM »
                             
AUTOMATSKI KODIRAJ LINKOVE
 

Ovo je sada dostupno kao mod.

http://custom.simplemachines.org/mods/index.php?mod=2881




           http://www.simplemachines.org/community/index.php?topic=415898.0

Ova modifikacija koda će sve linkove na Vašem forumu automatski pretvoriti u kod.

SMF 1.1.x

Za SMF 1.1.x koristite ovaj mod:

http://custom.simplemachines.org/mods/index.php?mod=1724

SMF 2.0

Sources/Subs.php 

Pronađite:

Code: [Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link new_win" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link new_win" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),


Zamijenite s:

Code: [Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<div class="codeheader">' . $txt['code'] . ' <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code href="$1" class="bbc_code">$1</code>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<div class="codeheader">' . $txt['code'] . ' <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code href="$1" class="bbc_code">',
'after' => '</code>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),


Slika je u privitku. (Hvala, Dzonny!  :D)
« Last Edit: January 27, 2011, 07:12:45 AM by Masterd »