add url to post

Support for IntegraMOD 140

Moderator: Integra Moderator

add url to post

PostAuthor: Skywalker » Sat Apr 15, 2006 1:31 pm

could someone make this work with integra i cant get the buttons to showup in viewtopic

Code: Select all
 ############################################################## ## MOD Title]http://www.CreativePulses.nl#[/url]# MOD Description: Extra field on the posting page.##                   -Input is an url##                   -http, ftp whatever##                   -'preview' button so user can see url##                   - SubSilver style 'www link' button##                   - You can pre-define some common urls :)#### MOD Version: 1.0.0## Tested on: PhpBB 2.0.17##   Should be phpBB version independent, if not let me know## ## Installation Level: easy## Installation Time: 5 Minutes## Files To Edit: (5)  root/viewtopic.php, root/posting.php##             root/includes/functions_post.php##            root/templates/[yourtemplatename]/posting_body.tpl##            root/templates/[yourtemplatename]/viewtopic_body.tpl## Included Files: (2) MOD_add_url_to_post_install.php##            mod_post_url_link.gif##############################################################  ############################################################## ## Authors Notes:##   ##   SubSilver style button:##       Made by Rfn, original files from SubSilver SDK##       [url=http://www.phpbb.com/downloads.php#subSilver]http://www.phpbb.com/downloads.php#subSilver[/url]## ##   Check ##          http://phpbb2italia.za.net/phpbb2/viewforum.php?f=12 ##       for updates, update manuals, support and screenshots####       Version History:##               1.0.0  -  20112005  -  first version####   If you like this mod add your phpbb forum url to: [url=http://www.rfn-online.tk#]http://www.rfn-online.tk#[/url]###   Thanks to:##       PhpBB styles team for the SubSilver SDK !!############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ##############################################################  # #-----[ COPY ]------------------------------------------ #mod_post_url_link.gif -> root/imagesMOD_add_url_to_post_install.php -> root/  # #-----[ OPEN ]------------------------------------------ #root/viewtopic.php  # #-----[ FIND ]------------------------------------------#     $template->assign_block_vars('postrow', array(         'ROW_COLOR' => '#' . $row_color,         'ROW_CLASS' => $row_class,  # #-----[ REPLACE WITH ]-----------------------------------#     // MOD post url txt   if (($post_url != '') && ($post_url != 'http://') && ($post_url != 'ftp://'))   {     $l_post_url = '<a><img></a>';     $post_url = '<a>'.$post_url.'</a>';      }    else    {   // empty sjizzle     $l_post_url = ''; $post_url = '';    }          // MOD post url txt     $template->assign_block_vars('postrow', array(         'POST_URL' => $post_url,         'L_POST_URL' => $l_post_url,         'ROW_COLOR' => '#' . $row_color,         'ROW_CLASS' => $row_class,                 # #-----[ OPEN ]------------------------------------------ #root/posting.php  # #-----[ FIND ]------------------------------------------#         $select_sql = ( !$submit )         # #-----[ BEFORE, ADD ]-----------------------------------#         // MOD post url txt                 # #-----[ FIND ]------------------------------------------#     pt.bbcode_uid, u.username, # #-----[ BEFORE, ADD ]-----------------------------------#      pt.post_url,            # #-----[ FIND ]------------------------------------------#if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' ){     $username = ( !empty($HTTP_POST_VARS['username']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['username']))) : '';     $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : '';     $message = ( !empty($HTTP_POST_VARS['message']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';     # #-----[ AFTER, ADD ]-----------------------------------#     // MOD post url keep field value while updating poll      $post_url = ( !empty($HTTP_POST_VARS['post_url']) ) ? $HTTP_POST_VARS['post_url'] : '';     // MOD post url       # #-----[ FIND ]------------------------------------------#     //     // User default entry point     //     if ( $mode == 'newtopic' )     {         $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';         # #-----[ AFTER, ADD ]-----------------------------------#         // MOD rfn post url             $post_url = 'http://';                         # #-----[ FIND ]------------------------------------------#         $message = $post_info['post_text'];           if ( $mode == 'editpost' )         {  # #-----[ AFTER, ADD ]-----------------------------------#             // MOD rfn post url             $post_url = $post_info['post_url'];             if($post_url =='') $post_url = 'http://';              # #-----[ FIND ]------------------------------------------#//// Output the data to the template//$template->assign_vars(array(     'POST_URL' => $post_url,     'USERNAME' => $username,         # #-----[ REPLACE WITH ]-----------------------------------#//// Output the data to the template//// MOD url rfn$template->assign_vars(array(     'POST_URL_TAG1' => ' -->',     'POST_URL_TAG2' => '<!-- ',     'POST_URL' => $post_url,     'USERNAME' => $username,                  # #-----[ OPEN ]------------------------------------------ #root/includes/functions_post.php  # #-----[ FIND ]------------------------------------------#     if ($mode != 'editpost')     {         $post_id = $db->sql_nextid();     }     # #-----[ AFTER, ADD ]-----------------------------------#     // MOD url rfn     $post_url = $_POST[post_url];       if ( $post_url == 'http://')     {         $post_url = null;     }       # #-----[ FIND ]------------------------------------------#     $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ('$post_url', $post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";  # #-----[ REPLACE WITH ]-----------------------------------#     $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_url, post_id, post_subject, bbcode_uid, post_text) VALUES ('$post_url', $post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_url = '$post_url', post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";                                 // MOD url rfn         # #-----[ OPEN ]------------------------------------------ #root/templates/[yourtemplatename]/posting_body.tpl  # #-----[ FIND ]------------------------------------------#<script><!--// bbCode control by  BEFORE, ADD<script>function post_url(text) {     document.post.post_url.value = text;}function visit_url() {     url = document.post.post_url.value;     if ((url != 'http://') && (url != '') && (url != 'ftp://'))     {         window.open(url,"visit_url","titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,width=750,height=400,scrollbars=1,resizable=1");   }     else     {         alert("Fill in a right format like http ftp");     }}</script>        # #-----[ FIND ]------------------------------------------#           <tr>             <td><span>               <textarea>{MESSAGE}</textarea>               </span></td>                  # #-----[ BEFORE, ADD ]-----------------------------------## Edit the autofill to pre-define some urls ! :)#             <!-- {POST_URL_TAG1}           <tr>             <td><font>Bron/url: </font><br><span>               <span>                 <input></span></span></td>           </tr>           <tr>             <td>             <div>               <table>                 <tr>                   <td><font>Autofill: </font><span>                   <font>[<a>Rfn mods at 3D forum</a>]                   - [<a>Google.com</a>] - [<a>PhpBB.com</a>]</font></span></td>                   <td> </td>                   <td>                   <p><input></td>                 </tr>               </table>             </div>             </td>           </tr>                     {POST_URL_TAG2} -->                                                               # #-----[ OPEN ]------------------------------------------ #root/templates/[yourtemplatename]/viewtopic_body.tpl  # #-----[ FIND ]------------------------------------------#             <tr>                 <td><hr></td>             </tr>             # #-----[ REPLACE WITH ]-----------------------------------#             <MOD>             </tr>              <tr>                 <td><span>{postrow.L_POST_URL} {postrow.POST_URL}</span></td>             </tr>               <MOD>                 <tr>                 <td><hr></td>             </tr>                         # #-----[ RUN ]------------------------------------------- #root/MOD_add_url_to_post_install.php                                      # #-----[ SAVE/CLOSE ALL FILES ]-------------------------- # # EoM



MOD_add_url_to_post_install.php

[code]  <?php  define('IN_PHPBB', 1);include($phpbb_root_path . 'extension.inc');include($phpbb_root_path . 'common.'.$phpEx);include($phpbb_root_path . 'config.'.$phpEx);  Echo "Starting DB upgrade .";   $sql = "ALTER TABLE " . POSTS_TEXT_TABLE . "ADD COLUMN `post_url` varchar(255) NULL DEFAULT `http]

(the install file gives an sql error i've created the column muself in phpmyadmin
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: add url to post

PostAuthor: GanBei » Sat Apr 15, 2006 1:43 pm

Try adding the sql statement manually with phpMyAdmin using the below commands:
[code]ALTER TABLE phpbb_posts_text ADD post_url varchar(255) DEFAULT 'http]
Substitute phpbb_ with your pre-defined prefix..
Last edited by GanBei on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://integramod-tw.net/images/links/integramod-tw.gif[/img] "UN-OFFICIAL" Traditional Chinese Support for IntegraMOD Project![/url]

GanBei
Members
Members
 
Posts: 38
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 6:48 am
Cash on hand: 0.00

Re: add url to post

PostAuthor: Skywalker » Sat Apr 15, 2006 1:46 pm

"GanBei";p="1758" wrote:Try adding the sql statement manually with phpMyAdmin using the below commands:
[code]ALTER TABLE phpbb_posts_text ADD post_url varchar(255) DEFAULT 'http]
Substitute phpbb_ with your defined prefix..


i have done that everything works it save's the url the only problem is it dus not get showed on viewtopic...
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00


Return to IntegraMOD 140

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot], Paulmagall