• Welcome to Simple Machines Community Forum. Please login or sign up.

Reflection Img BBC

Started by M-DVD, September 25, 2008, 06:27:23 PM

Previous topic - Next topic

M-DVD

Hi

I thought it would take longer, but I made the adjustment.  :D

I will send a mail to Cow (author of reflect.js) informing of the changes.

When I have the answer, I will update the MOD.

Quote from: Lafemme on January 09, 2009, 05:41:42 PM
Perfect! Then this can be used in so many ways :D Maybe you can also add the ALT tag for keywords.

Yes, this attribute is already added.  :D (alt, height, width, ropacity and rheight.)

Quote from: Lafemme on January 09, 2009, 05:41:42 PM
here is the dutch translation :D

$txt['refle'] = 'Voeg afbeelding met reflectie toe.';]

maybe it's better to place this string in the first post so that everyone can easily find the string and translate it :D

Thanks for translate. I will include in the package in the next version.

PD: This string in first post?

$txt['refle'] = 'Insert Image with Reflection';

Already there.  :)

MissyNL

Great!

I cant wait :D since this mod really rocks!
Sorry for my poor English, but i think it's probably better then your Dutch :)

RazzLee

January 17, 2009, 04:10:21 PM #22 Last Edit: January 17, 2009, 04:17:28 PM by RazzLee
Hello,
Great mod! Except I can't seem to get it to work right  :-[

I hope I'm just making the tags wrong:
[refle][img]http://www.myimagehosting.com[/img][/refle]

this is my first mod that I've DLed so it is likely that I did something wrong...
If anyone would kindly take some time to help me out, I would be very greatful!

Thanks!
-Razz

EDIT: ok...I see that I was adding the img tag unnecessarily. The image is showing now but no reflection...

MissyNL

yes :D your have to leave the image tag.

[refle]http://www.myimagehosting.com[/refle]

good luck :D
Sorry for my poor English, but i think it's probably better then your Dutch :)

M-DVD

Update Reflection Img BBC v1.2:
=====================


New features:

  • Added hspace, vspace & align attribute

How do I upgrade?

  • Uninstall the previous version
  • Install the new
  • Do Hard Refresh or Clean Temporal Files

=======================================

Características Nuevas:

  • Añadidos los atributos hspace, vspace y align

¿Como actualizar?

  • Desintalar la anterior versión
  • Instalar la nueva
  • Actualiza con Ctrl+F5 o borra temporales

MissyNL

Wow! thank you! I've installed it without any problems..

this will make my forum even look better and now i can use it more often as you implemented the new codes..

thanks!
Sorry for my poor English, but i think it's probably better then your Dutch :)

M-DVD


AlenNS

This mod stops working for me.

Here is the code I get when try to reflect some image.

[refle]http://[url=http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg]http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg[/url][/refle]

Something is wrong here... :-\

M-DVD

Quote from: AlenNS on March 12, 2009, 10:49:22 AM
This mod stops working for me.

Here is the code I get when try to reflect some image.

[refle]http://[url=http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg]http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg[/url][/refle]

Something is wrong here... :-\

Because "http://[url=http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg]http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg[/url]" isn't URL valid.

The correct is:

[url=URL][img]URL[/img][/url]

and

[url=URL][refle]URL[/refle][/url]

ie:

[url=http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg]
[refle]http://www.footballpictures.net/data/media/20/ac_milan_logo.jpg[/refle]
[/url]




AlenNS

I know, but when I click on refle BBC and add some picture link it writes that link like that, not me. :-/

DeviDarkL

March 14, 2009, 09:21:01 AM #30 Last Edit: March 14, 2009, 10:57:02 PM by DeviDarkL
Great Mod (again and again :P)

Portuguese_PT Translation & Brazilian Translation(normal and utf8):
<file name="$languagedir/Modifications.portuguese_pt.php"  error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// MOD Reflection Img BBC
$txt['refle'] = 'Inserir Imagem com Reflexo';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// MOD Reflection Img BBC
$txt['refle'] = 'Inserir Imagem com Reflexo';]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// MOD Reflection Img BBC
$txt['refle'] = 'Inserir Imagem com Reflexo';]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// MOD Reflection Img BBC
$txt['refle'] = 'Inserir Imagem com Reflexo';]]></add>
</operation>
</file>

DeviDarkL

Hi M-DVD

I instaled this mod and in the default template works fine but in a custom template it doesn't :(

And Yes, I did the mod needed to work in index.template.php. Post.template.php doesn't exist in Silent Wave template so I think the template is using the default post.template.

Here is the Index.template.php from the custom theme:
<?php
// Version: 2.0 Beta 4; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 Beta 4';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;

/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;

/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;
}

// The main sub template above the content.
function template_html_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title_html_safe'], '" />
<meta name="keywords" content="'
$context['meta_keywords'], '" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?b4"></script>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/theme.js?b4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_default_theme_url = "'
$settings['default_theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
if (confirm("' 
$txt['show_personal_messages'] . '"))
window.open("' 
$scripturl '?action=pm");' '''
var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
// ]]></script>
<title>'
$context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />'
;

// The ?b4 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style'$context['theme_variant'], '.css?b4" />';

echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/print.css?b4" media="print" />';

// IE7 needs some fixes for styles.
if ($context['browser']['is_ie7'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/ie7.css" />';
// ..and IE6!
elseif ($context['browser']['is_ie6'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/ie6.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
$scripturl'?board='$context['current_board'], '.0" />';

  // YSHOUT HERE - <head> code
   
global $boardurl,$shoutFile;
   
$shoutFile='home';
   
$scripturlparsed parse_url($scripturl);
   
$scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
   
$args='';
   foreach(
$_GET as $key => $value// passthrough $_GET
      
$args.='&'.urlencode($key).'='.urlencode($value);
   echo 
'
   <script src="'
,$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="'
,$boardurl,'/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   window.onload=function(){loadChat();};
   var shoutFile="'
,$shoutFile,'";
   var yshout_php="'
,$scriptpath,'?yshout',$args,'";
   // ]]></script>
   <script src="'
,$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
   <style type="text/css">
      #yshout #shouts {
         overflow: auto;
         height: 180px;     /* the height you want to display */
  }
  #yshout {
         font-size: 10px;
         overflow: hidden;
      }
      #yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
      }
      #yshout #shouts { /* main shouts area */
      }
      #yshout .shout { /* one shout */
         margin: 0 0 0; /* Top Bottom Linespacing */
         line-height: 1;
      }
      #yshout .shout-timestamp {
         font-style: normal;
         font-weight: normal;
      }
      #yshout .shout-adminlinks { /* del and ban buttons */
         font-size: 6pt;
         color: #141414;
      }
      #yshout #shout-form {
         margin: 0;
         padding: 0;
      }
      #yshout #shout-form fieldset {
         border: none;
      }
      #yshout #forum-name {
         width: 70px;
         margin-right: 5px;
      }
      #yshout #shout-text {
         width: 310px;
         margin-right: 5px;
      }
      #yshout #shout-button {
         width: 55px;
      }
      #yshout .shout-invalid { /* invalid shout (shout textbox) */
         background: #FFFDD1;
      }
   </style>'
;
   
// YSHOUT END - <head> code

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", '
, empty($options['collapse_header']) ? 'false' 'true'');
mainHeader.useCookie('
$context['user']['is_guest'] ? 0');
mainHeader.setOptions("collapse_header", "'
$context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>'
;

echo '
</head>
<body>'
;
}

function 
template_body_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo 
'
<div id="wrapper">
<div id="header">
<div id="welcome">'
;
if ($context['user']['is_logged'])
{
echo '
<b>'
$txt['hello_member_ndt'], ' '$context['user']['name'], '</b><br />';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt['msg_alert_you_have'], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';
}

// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);
echo '
<br />'
$context['current_time'],'<br />';
}

echo '
</div>
<a href="'
.$scripturl.'" title=""><span id="logo">&nbsp;</span></a>';
echo '
</div>
<div id="toolbar">
<div id="nav">
'
,template_menu(),'
</div>
</div>
<div id="mainarea">'
;

// Show the navigation tree.
theme_linktree();

}

function 
template_body_below()
{
global $context$settings$options$scripturl$txt;

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
'
theme_copyright(), '
<br /><a href="http://www.dzinerstudio.com" target="_blank">DzinerStudio</a>'
;

// Show the load time?
if ($context['show_load_time'])
echo '<br /><span class="smalltext">'$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</span>';

echo '
</div>'
;
}

function 
template_html_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo 
'
</div>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/reflection.js?b4"></script>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show false)
{
global $context$settings$options$shown_linktree;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

//!!! Temporarily don't do it twice.
if (!empty($shown_linktree))
return;
$shown_linktree true;

echo '
<ul id="linktree">'
;

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li'
, ($link_num == count($context['linktree']) - 1) ? ' class="last"' '''>';
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' 
$tree['url'] . '"><span>' $tree['name'] . '</span></a>' '<span>' $tree['name'] .'</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>';

echo '
</li>'
;
}
echo '
</ul>'
;
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

echo '
<ul>'
;
foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a '$button['active_button'] ? ' class="current"' '' ' href="'$button['href'], '"><span>'$button['title'], '</span></a></li>';

echo '
</ul>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
global $settings$context$txt$scripturl;

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '<a href="' $value['url'] . '" ' . (isset($value['custom']) ? $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a>';
}

if (empty($buttons))
return '';

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

echo '
<div class="buttonlist'
$direction != 'top' '_bottom' '''">
<ul class="clearfix">
<li>'
implode('</li><li>'$buttons), '</li>
</ul>
</div>'
;

}

function 
tlist_bits($element)
{
global 
$txt$settings$scripturl;

switch($element)
{
case 'container_open':
$answ '<table cellspacing="1" border="0" class="tlisttable">';
break;
case 'header':
$answ ='<tr><th><div class="tlisttitleicon"><a name="tl_{JLABEL}">&nbsp;</a></div></th><th>{TITLE}</th></tr>';
break;
case 'topic_row':
{
$answ '<tr><td class="tlistcol1"><img class="tlistfirsticon" src="{ICON}" alt="" /></td>';
$answ .= '<td class="tlistcol2"><a href="'.$scripturl.'?topic={TOPIC_ID}">{TOPIC_TITLE}</a></td></tr>';
break;
}
case 'container_close':
$answ '</table>';
break;
case 'no_topics':
{
$answ '<tr><td class="tlistcol1"><img class="tlistfirsticon" src="'.$settings['images_url'].'/tlist_spacer.gif" alt="" width="20" /></td>';
$answ .= '<td class="tlistcol2">-</td></tr>';
break;
}
case 'index_container_open':
$answ '<div class="tlistindex">'.$txt['jump_to'];
break;
case 'index_bit':
$answ ' <a href="#tl_{TITLE}">{TITLE}</a>';
break;
case 'index_container_close':
$answ '</div>';
break;
}
return $answ;
}

?>


Can you help me? :)

AlenNS

Quote from: AlenNS on March 12, 2009, 09:56:54 PM
I know, but when I click on refle BBC and add some picture link it writes that link like that, not me. :-/
Bump :-/

DeviDarkL


wiki

Hi and thx for a great idea.

I install the mod but is not reflect images I am using another theme not the default for SMF 2 RC1 and also something is wrong at post is not show the button:


DeviDarkL

Hi wiki.

In order to show the button, you need to upload it's image to the images directory of your current theme.

Hum.. I see that your problem is the same happing to me. If you change to the default theme you should see the reflect. Somehow reflection isn't working in other themes even though their files are changed too :'(

M-DVD, help is need in this sector :D

wiki

Quote from: DeviDarkL on March 18, 2009, 08:01:57 PM
Hi wiki.

In order to show the button, you need to upload it's image to the images directory of your current theme.

Hum.. I see that your problem is the same happing to me. If you change to the default theme you should see the reflect. Somehow reflection isn't working in other themes even though their files are changed too :'(

M-DVD, help is need in this sector :D

Thank you for your help yes i can see the button now but still no reflection.

M-DVD

Sorry, i'm "missing" of SMF, because it was sick and now i have work accumulated (in real life).

Quote from: AlenNS on March 12, 2009, 09:56:54 PM
I know, but when I click on refle BBC and add some picture link it writes that link like that, not me. :-/

I don't understand why this happens. Unless you're doing something wrong or you have a misunderstanding.

1.- Click in BBCode Refle -----> [refle][/refle]

2.- Paste the URL -----> [refle]URL[/refle]

3?.- Select all and click BBCode Url --------> [url][refle]URL[/refle][/url]

Where is wrong?.

Quote from: DeviDarkL on March 16, 2009, 04:59:19 PM
Hi M-DVD

I instaled this mod and in the default template works fine but in a custom template it doesn't :(

And Yes, I did the mod needed to work in index.template.php. Post.template.php doesn't exist in Silent Wave template so I think the template is using the default post.template.

Here is the Index.template.php from the custom theme:

Can you help me? :)

That does not work ...
Do you not see the reflection?
Do you not see the button BBCode?

Another question: what SMF version are you use?

And yes, if your theme not have post.template, then it uses the default file.

Quote from: wiki on March 18, 2009, 10:38:49 PM
Thank you for your help yes i can see the button now but still no reflection.

What SMF version are you use?

Did you change yours index.template?

Did you upload the reflect.js file?

PD: Thank DeviDarkL  for help :P

Quote from: DeviDarkL on March 14, 2009, 09:21:01 AM
Great Mod (again and again :P)

Portuguese_PT Translation & Brazilian Translation(normal and utf8):


Thanks for translate :D

In the next weeks, i upload your work. Thanks.

DeviDarkL

Quote from: M-DVD on March 19, 2009, 11:12:03 AM
PD: Thank DeviDarkL  for help :P

No hay problema :P ¿uno para todos y todos para uno, no? ;) eheh!




I do see the BBC button and I have my index.template.php changed, here is a part of it where Reflection code is:
echo '
</div>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/reflection.js?b4"></script></body></html>';
}


I even can copied the default scripts folder for my custom theme directory but we no luck >:(

I only see the reflections if I change to the default theme of SMF. In any other theme, the reflection doesn't work. The version I'm using is 2.0 Beta 4.

Tiribulus

I had to move the reflection.js file into the folder for my theme if I remember right.

Advertisement: