Download BBCode
| Article |
 Download BBCode
|
Customization description
This BBCode will allow you to add links to downloads when posting.
The link will look like this:
You'll be able to add this with the tag Not Authorized You are not authorized to download this file
You'll also be able to set the target (by default _blank). For example Not Authorized You are not authorized to download this file .
Installation instructions
- To download images right click on them and choose "Save image".
Upload to images/bbcb_mg/images/gif/download.gif (image by Danilo)
Upload to images/download.gif (image found in Deviantart)
- Apply code changes:
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
'codeblock' => array(
'nested' => false,
'inurl' => false,
),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'download' => array(
'nested' => false,
'inurl' => false,
),
#
#-----[ FIND ]------------------------------------------
#
// OPACITY
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// DOWNLOAD
if($tag === 'download')
{
if(empty($content) || $this->is_sig)
{
return $error;
}
if (isset($item['params']['target']))
{
$target = $item['params']['target'];
}
else
{
$target = '_blank';
}
$html = '<a href="' . $content . '" target="' . $target . '"><img src="' . $phpbb_root_path . 'images/download.gif" alt="' . $lang['Download'] . '" title="' . $lang['Download'] . '" border="0" /></a>';
return array(
'valid' => true,
'html' => $html
);
}
Apply this to all languages you have installed: #
#-----[ OPEN ]------------------------------------------
#
language/lang_english/bbcb_mg.js
#
#-----[ FIND ]------------------------------------------
#
s_posticyimage = '
#
#-----[ AFTER, ADD ]------------------------------------------
#
s_download_insert = 'Please write file URL';
#
#-----[ FIND ]------------------------------------------
#
s_smiley_creator = '
#
#-----[ AFTER, ADD ]------------------------------------------
#
s_download_help = 'Download: [download]URL[/download] Insert a link to a file';
#
#-----[ FIND ]------------------------------------------
#
'[emff]','[/emff]'
#
#-----[ REPLACE WITH ]------------------------------------------
#
'[emff]','[/emff]',
'[download]','[/download]'
#
#-----[ FIND ]------------------------------------------
#
var ToAdd = "[url=" + enterURL + "]" + enterTITLE + "[/url]";
}
PostWrite(ToAdd);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
function BBCdownload()
{
var FoundErrors = '';
var enterURL = prompt(s_download_insert, s_url_insert_tip);
if (!enterURL)
{
FoundErrors += s_url_error;
}
if (FoundErrors)
{
alert(s_gen_error + FoundErrors);
return;
}
var ToAdd = "[download]" + enterURL + "[/download]";
PostWrite(ToAdd);
}
Apply this to all templates you have installed: #
#-----[ OPEN ]------------------------------------------
#
templates/mg_themes/bbcb_mg.tpl
#
#-----[ FIND ]------------------------------------------
#
<a href="javascript:BBCurl()" accesskey="w"><img src="{BBCB_MG_IMG_PATH}url{BBCB_MG_IMG_EXT}" name="url" onMouseOver="helpline('url')" alt="{L_BBCB_MG_URL}" title="{L_BBCB_MG_URL}" class="bbimages" /></a>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<a href="javascript:BBCdownload()" accesskey="d"><img src="{BBCB_MG_IMG_PATH}download{BBCB_MG_IMG_EXT}" name="download" onMouseOver="helpline('download')" alt="{L_BBCB_MG_DOWNLOAD}" title="{L_BBCB_MG_DOWNLOAD}" class="bbimages" /></a>
- Clean cache
Enjoy this mod! 
Edited by KasLimon, Sun 24 Feb, 2008 22:34: Correcting images...
|
|
KasLimon [ Sun 24 Feb, 2008 22:17 ]
|
 |
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
 |
Download BBCode
| Comments |
 Re: Download BBCode
|
Nice work Kas! 
|
|
ThE KuKa [ Sun 24 Feb, 2008 22:49 ]
|
 |
 Re: Download BBCode
|
Restored to Customizations, It still works 
|
|
KasLimon [ Sat 08 Mar, 2008 11:43 ]
|
 |
 Re: Download BBCode
|
|
hello all... You can do that you can not download the file if not answered in this topic where you download??
|
|
TopoMotoV3X [ Mon 08 Jun, 2009 14:52 ]
|
 |
 Re: Download BBCode
|
there is no download except for the images...
to make the mod work you have to follow the code changes in the first post... click on the spoiler

|
|
DWho [ Mon 08 Jun, 2009 22:09 ]
|
 |
 Re: Download BBCode
|
I made the changes to the code, but on icy italy I was told that with a little modification, could use this mod to stop the download for those who do not respond in the topic..
I had to replace the original code bbcode.php (made from KasLimon) with this:
// DOWNLOAD
if($tag === 'download')
{
if(!$userdata['session_logged_in'])
{
$html = '<a href="' . append_sid(PROFILE_MG . '?mode=register') . '" target="_blank">$lang['Links_For_Guests']</a>';
}
else
{
// Start initial var setup
$forum_id = 0;
$topic_id = 0;
$post_id = 0;
if (isset($_GET[POST_FORUM_URL]) || isset($_POST[POST_FORUM_URL]))
{
$forum_id = (isset($_GET[POST_FORUM_URL])) ? intval($_GET[POST_FORUM_URL]) : intval($_POST[POST_FORUM_URL]);
}
elseif (isset($_GET['forum']))
{
$forum_id = intval($_GET['forum']);
}
else
{
$forum_id = '';
}
if (isset($_GET[POST_TOPIC_URL]))
{
$topic_id = intval($_GET[POST_TOPIC_URL]);
}
elseif (isset($_GET['topic']))
{
$topic_id = intval($_GET['topic']);
}
if (isset($_GET[POST_POST_URL]))
{
$post_id = intval($_GET[POST_POST_URL]);
}
$forum_id_append = (!empty($forum_id) ? (POST_FORUM_URL . '=' . $forum_id) : '');
$topic_id_append = (!empty($topic_id) ? (POST_TOPIC_URL . '=' . $topic_id) : '');
$post_id_append = (!empty($post_id) ? (POST_POST_URL . '=' . $post_id) : '');
$post_id_append_url = (!empty($post_id) ? ('#p' . $post_id) : '');
$sql = "SELECT u.*, p.*
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE p.topic_id = $topic_id
AND u.user_id = p.poster_id";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, "Could not read post information.", '', __LINE__, __FILE__, $sql);
}
$postrow = array();
if($row = $db->sql_fetchrow($result))
{
$postrow[] = $row;
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
$total_posts = count($postrow);
if(empty($content) || $this->is_sig)
{
return $error;
}
if (isset($item['params']['target']))
{
$target = $item['params']['target'];
}
else
{
$target = '_blank';
}
for($i = 0; $i < $total_posts; $i++)
{
$poster_id = $postrow[$i]['user_id'];
if($poster_id == $userdata['user_id'])
{
$html = '<a href="' . $content . '" target="' . $target . '"><img src="' . $phpbb_root_path . 'images/download.gif" alt="' . $lang['Download'] . '" title="' . $lang['Download'] . '" border="0" /></a>';
}
else
{
$html = '<a href="' . append_sid('posting.' . PHP_EXT . '?mode=reply&' . $forum_id_append . '&' . $topic_id_append) . '" target="' . $target . '">' . $lang['Reply_For_Download'] . '</a>';
}
}
}
return array(
'valid' => true,
'html' => $html
);
}
2) file (language / lang_ * / lang_main.php)
before:
I added the following code:
$lang['Reply_For_Download'] = 'You must answer the question to start the download.';
but does not work .... 
|
|
TopoMotoV3X [ Tue 09 Jun, 2009 01:23 ]
|
 |
 Re: Download BBCode
|
|
thanks
|
|
nittayay [ Thu 10 Nov, 2011 12:30 ]
|
 |
 Re: Download BBCode
|
|
non vedendo nesuna sezzione per i saluti anche sapendo che non e la sezione giusta saluto qua tutto il forum
volevo chiedere come mai non riesco a scaricare mi serve questo codice grazie a tutti e buon lavoro
|
|
antonio11 [ Thu 19 Apr, 2012 16:45 ]
|
 |
 Re: Download BBCode
|
Hello and welcome to IcyPhoenix,
No this is not the right place to greet the whole forum, please use the "Chit Chat" section for that:
http://www.icyphoenix.com/forum.php?c=48
Please take note that this is an English speaking board, so please write in English, the Only Place where you are allowed to write in Italian is here:
http://www.icyphoenix.com/viewforum.php?f=18
So in this topic please write in English (or use google-translate to translate your message to english)
About your Question:
there is no download except for the images...
to make the mod work you have to follow the code changes in the first post... click on the spoiler
So you can download the pictures and make the codechanges ... the rest are only examples!
Greetings,
...Joshua203
Translations below (click "show" to read):
Portugese Translation wrote:
Olá e bem vindo ao IcyPhoenix,
Não, este não é o lugar certo para cumprimentar o fórum inteiro, por favor use o "Chit Chat" seção para que:
http://www.icyphoenix.com/forum.php?c=48
Por favor, tome nota que este é um conselho que fala Inglês, então por favor escrever em Inglês, o único lugar onde você tem permissão para escrever em italiano está aqui:
http://www.icyphoenix.com/viewforum.php?f=18
Portanto, neste tópico, por favor escrever em Inglês (ou use google-traduzir para traduzir a sua mensagem para Inglês)
Sobre sua pergunta:
não há download exceto para as imagens ...
para fazer funcionar o mod você tem que acompanhar as mudanças de código no primeiro post ... clique sobre o spoiler
: mrgreen :: mrgreen:
Assim, você pode baixar as fotos e fazer as codechanges ... o resto são apenas exemplos!
Saudações,
... Joshua203
Italian Translation wrote:
Ciao e benvenuto IcyPhoenix,
No questo non è il posto giusto per salutare tutto il forum, si prega di utilizzare il "Chit Chat" per che:
http://www.icyphoenix.com/forum.php?c=48
Si prega di prendere atto che si tratta di una scheda di lingua inglese, quindi si prega di scrivere in inglese, l'unico posto dove è permesso di scrivere in italiano è qui:
http://www.icyphoenix.com/viewforum.php?f=18
Quindi, in questo argomento si prega di scrivere in inglese (o usare google-translate per tradurre il messaggio all'inglese)
Alla vostra domanda:
non vi è alcun download, tranne per le immagini ...
per far funzionare il mod è necessario seguire i cambiamenti di codice nel primo post ... clicca sul spoiler
: mrgreen :: mrgreen:
Quindi, è possibile scaricare le immagini ed effettuare le codechanges ... il resto sono solo degli esempi!
saluti,
... Joshua203
|
|
Joshua203 [ Thu 19 Apr, 2012 18:07 ]
|
 |
 Re: Download BBCode
|
|
scusate lignoranza ma quaste modifiche si devono fare nei templat se si in quale template grazie
|
|
antonio11 [ Thu 19 Apr, 2012 18:45 ]
|
 |
 Re: Download BBCode
|
|
non capito ... ENGLISH ONLY PLEASE!
If you don't use google translate why would I?
|
|
Joshua203 [ Thu 19 Apr, 2012 19:04 ]
|
 |
 Re: Download BBCode
|
Joshua203 wrote: [View Post] non capito ... ENGLISH ONLY PLEASE!
If you don't use google translate why would I?
excuse the ignorance but how much change must rate YES if YES nia template in Which model Thanks
|
|
antonio11 [ Fri 20 Apr, 2012 17:27 ]
|
 |
 Re: Download BBCode
|
|
The install instructions are all in the first post (in the spoiler, click to open the window)
In the last section is explained that you need to do those edits to ALL templates you are using, anything before the last section is done to a function file (bbcode) and ALL languages you are using.
Be aware that this is for IcyPhoenix only.
And please be aware that this is a very old MOD ( Older Versions Archive » Old Customizations) ... I don't know if this would still work on the current versions!!
Maybe someone else can tell you more about this.
Greetings,
...Joshua203
|
|
Joshua203 [ Sat 21 Apr, 2012 01:38 ]
|
 |
|
|
Was this topic useful?
Was this topic useful?
|
Page 1 of 1
|
|
|