• 1
  • 11 RepliesReplies
  • 7767 ReadTimes Read
  • 3 PointsPoints

Topic: SMF Shop estilo webs linksharing (Puntos al tema)

no avatar
Usuario: marcelo53
Rango: Nuevo Usuario
Mensajes: 4
Points: 5
Perfil: View Profile

Esta es una personalizacion del mod SMF-Shop y Bookmark.
Solo es para SMF 2 RC.X y fue testeado en el theme por defecto de smf (curve)

La personalizacion de este mod contiene:
Conteo de puntos al tema
Quien dio puntos al tema
Conteo de cuantas veces se agrego a favoritos el tema.
Popup al dar puntos, error al querer dar nuevamente puntos al mismo tema.
Mensaje privado al creador del post que se le dio puntos con enlace hacia el tema.
Todo lo que se aprecia en la captura.

Mods necesarios:
Smf Shop
Bookmark



Display.template.php

1.- Buscan:

Code: [Select]

      // Maybe they want to report this post to the moderator(s)?
      if ($context['can_report_moderator'])
Reemplazan por:


Code: [Select]
      // Maybe they want to report this post to the moderator(s)?
      if ($context['can_report_moderator'] && $message['id'] != $context['topic_first_message'])
2.- Buscan:

Code: [Select]

   }

   echo '
            </form>
         <>
         <a id="lastPost"></a>';
Reemplazan por:

Code: [Select]

      echo '
            </form>';
           
   //Custom SMF Shop
   global $user_info;
   if ($message['id'] == $context['topic_first_message'])
   {
   echo '
      <span class="upperframe"><span></span></span>
      <div class="tools_post roundframe over">
      <div class="floatleft">
        <ul class="reset over clear">
        <li class="buttons"><a class="book" href="',  $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id'],'">',$txt['skm_add_book'],'</a></li>
        <li class="buttons"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">',$txt['skm_report_topic'],'</a></li>';

     if ($user_info['id'] != $context['id_started'] && $message['id'] == $context['topic_first_message']&& !$context['user']['is_guest'])
     {
     echo '
        <li>
         <form action="'. $scripturl. '?action=shop;do=sendmoney2;topic='. $context['current_topic'].'" method="post">
         <input type="hidden" value="'.$context['value_name']. '" name="membername" id="membername">
         <select id="amount" name="amount">
          <option disabled="disabled">'. $txt['skm_send_points'].'</option>
          <option value=" 1"> 1</option>
          <option value=" 2"> 2</option>
          <option value=" 3"> 3</option>
          <option value=" 4"> 4</option>
          <option value=" 5"> 5</option>
          <option value=" 6"> 6</option>
          <option value=" 7"> 7</option>
          <option value=" 8"> 8</option>
          <option value=" 9"> 9</option>
          <option value=" 10"> 10</option>
         </select>
         <input type="submit" value="'. $txt['skm_send'].'">
         </form>
        </li>';
     }
    echo '
      </ul>';
    echo '
      <div clas="clear">';
     if($context['num_points'] > 0)
      echo $txt['points_in_topics'].': '.implode(', ', $context['list_points_topics']);
     else
     echo $txt['no_points_topics'];
     echo '
      <hr /><span class="coments disblock"><span>',$context['num_replies'],'</span> ',$context['num_replies'] == 1 ? $txt['skm_coment'] : $txt['skm_coments'],'</span>
     <>
      <>
      <div class="floatright">
       <ul class="reset over floatright">
         <li><span>'.$context['num_points'].'</span>'. $txt['skm_points'].'</li>
         <li class="views"><span>'.$context['num_views'].'</span>'. $txt['skm_views'].'</li>
         <li class="totalbook"><span>'.$context['total_bookmarks'].'</span>'. $txt['skm_book'].'</li>
       </ul>';
      $urls = urlencode($scripturl.'?topic='.$context['current_topic'].'.0');
      $imgs = $settings['images_url'];
      echo '
        <div class="share_topic clear">   
        <span class="disblock floatleft">',$txt['skm_share_topic'],':</span>   
        <a href="http://digg.com/submit?phase=2&amp;url='.$urls.'" title="'.$txt['skm_digg'].'"><img src="'.$imgs.'/digg.png" alt="" /></a>
        <a href="http://twitter.com/home?status='.$urls.'&amp;title='.$context['page_title'].'" title="'.$txt['skm_twit'].'"><img src="'.$imgs.'/twitter.png" alt="" /></a>
        <a href="http://www.facebook.com/sharer.php?u='.$urls.'&amp;t='.$context['page_title'].'" title="'.$txt['skm_face'].'"><img src="'.$imgs.'/facebook.png" alt="" /></a>
        <a href="http://del.icio.us/post?url='.$urls.'&amp;title='.$context['page_title'].'" title="'.$txt['skm_deli'].'"><img src="'.$imgs.'/delicious.png" alt="" /></a>
        <>         
      <>
      <>
      <span class="lowerframe"><span></span></span><br class="clear" />';
   }
   //End Custom SMF Shop
   
   }

   echo '
         <>
         <a id="lastPost"></a>';
3.- Buscan:

Code: [Select]

   echo '
            <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';

   $ignoredMsgs = array();
   $removableMessageIDs = array();
   $alternate = false;

   // Get all the messages...
   while ($message = $context['get_message']())
   {
reemplazan por:


   
Code: [Select]
$ignoredMsgs = array();   $removableMessageIDs = array();
   $alternate = false;

   // Get all the messages...
   while ($message = $context['get_message']())
   {

   echo '
            <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
Shop-Send.php (sources/shop/)
4.- Buscan (El codigo que esta en la linea 51 aproximadamente):


Code: [Select]

      // No results? They don't exist!
      if ($smcFunc['db_num_rows']($result) == 0)

reemplazan por:


     
Code: [Select]
  //Custom SMF Shop         global $topic;
         $points_error = $smcFunc['db_query']('', "
            SELECT *
            FROM {db_prefix}topics_points
            WHERE id_member = {int:id}
            AND id_topic = {int:topic}
            LIMIT 1",
            array(
               'topic' => $topic,
               'id' => $context['user']['id'],
            ));
         $fatal_error = $smcFunc['db_fetch_assoc']($points_error) != 0 ? true : false;
         $smcFunc['db_free_result']($points_error);   

      if ($fatal_error && !empty($topic))
      {
         echo '
         <script type="text/javascript"><!-- // --><![CDATA[
         alert("'.$txt['already_gave_points'].'");
         document.location=(\''.$scripturl . '?topic='.$topic.'.0\');
         // ]]></script>';
         $context['shop_buy_message'] ='';
      }
        //End Custom SMF Shop
     
      // No results? They don't exist!
      elseif ($smcFunc['db_num_rows']($result) == 0)

5.- buscan:


     
   
Code: [Select]
// Who the IM will come fromreemplazan por:

Code: [Select]

         //Custom SMF Shop
         if(!empty($topic))
         {
         $smcFunc['db_query']('', "
            UPDATE {db_prefix}topics
            SET num_points = num_points   {float:amount}
            WHERE id_topic = {int:topic}
            LIMIT 1",
            array(
               'amount' => $amount,
               'topic' => $topic,
            ));
           
         $smcFunc['db_query']('', "
            INSERT INTO {db_prefix}topics_points
            (id_topic,id_member,num_points)
            values({int:topic}, {int:id}, {float:amount})",
            array(
               'topic' => $topic,
               'id' => $context['user']['id'],
               'amount' => $amount,
            ));
         }
         //End Custom SMF Shop
     
         // Who the IM will come from   
6.- buscan:


         
Code: [Select]
$message = sprintf($txt['shop_im_sendmoney_message'], $context['user']['name'], formatMoney($amount), $_POST['message']);reemplazan por:


Code: [Select]
         @$message = sprintf($txt['shop_im_sendmoney_message'], $context['user']['name'], formatMoney($amount), $_POST['message']);
         
            //Custom SMF Shop
         if(!empty($topic))
         {
         @$message = sprintf($txt['member_send_points'], $context['user']['name'], $amount, '[url='.$scripturl . '?topic='.$topic.'.0]Post[/url]');
         }
         //End Custom SMF Shop

7.- buscan:


   
   
Code: [Select]
   $context['shop_buy_message'] = sprintf($txt['shop_successfull_send'], formatMoney($amount), $moneyTo);reemplazan por:


   
     
Code: [Select]
$context['shop_buy_message'] = sprintf($txt['shop_successfull_send'], formatMoney($amount), $moneyTo);         
           //Custom SMF Shop
         if(!empty($topic))
         {
         echo '
         <script type="text/javascript"><!-- // --><![CDATA[
         alert("'.$amount.$txt['exit_send_points'].'");
         document.location=(\''.$scripturl . '?topic='.$topic.'.0\');
         // ]]></script>';
            }
           //End Custom SMF Shop
Display.php (sources)
8.- buscan:


   
     
Code: [Select]
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll,reemplazan por:


   
     
Code: [Select]
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll, t.num_points,9.- buscan:


   
Code: [Select]
$context['mark_unread_time'] = $topicinfo['new_from'];reemplazan por:


   
Code: [Select]
$context['mark_unread_time'] = $topicinfo['new_from'];
   $context['num_points'] = $topicinfo['num_points'];
10.- buscan:


   
Code: [Select]
$attachments = array();reemplazan por:


 
Code: [Select]
  //Custom SMF Shop   global $topic, $smcFunc;
   $favoritos = $smcFunc['db_query']('','
      SELECT bk.id_topic
      FROM {db_prefix}bookmarks AS bk
      WHERE bk.id_topic = {int:topic}',
      array(
         'topic' => $topic,
      )
   );
   $context['total_bookmarks'] = $smcFunc['db_num_rows']($favoritos);
   
   global $topic, $smcFunc;
   $consulta = $smcFunc['db_query']('','
      SELECT *
      FROM {db_prefix}topics AS t,
           {db_prefix}members AS m
      WHERE t.id_member_started = m.id_member
        AND t.id_topic = {int:topic}',
      array(
         'topic' => $topic,
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($consulta))
   {
        $context['id_started'] = $row['id_member_started'];
      $context['value_name'] = $row['member_name'];
   }
   $smcFunc['db_free_result']($consulta);
   
   $request_points = $smcFunc['db_query']('','
      SELECT pt.id_member, pt.num_points, mem.real_name, g.online_color
      FROM {db_prefix}topics_points AS pt,
           {db_prefix}members AS mem,
          {db_prefix}membergroups AS g
      WHERE pt.id_member = mem.id_member
        AND g.id_group = IF (mem.id_group = 0, mem.id_post_group, mem.id_group)
        AND pt.id_topic = {int:topic}',
      array(
         'topic' => $topic,
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($request_points))
   {   
       $link_user = '<a style="color: '.$row['online_color'].';" href="'. $scripturl. '?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a> ('.$row['num_points'].')';
        $context['points_topics'][$row['id_member']] = array(
            'link' => $link_user,
      );
      $context['list_points_topics'][$row['id_member']] = $link_user;
   }
   $smcFunc['db_free_result']($request_points);
   //End Custom SMF Shop

   $attachments = array();
Modifications.spanish(english,latin,etc).php (Themes/Default/languajes/)

11.- Buscan:


Code: [Select]
?>y antes agregan:


Code: [Select]
//Custom SMF Shop
$txt['member_send_points'] = '%s te ha enviado %s puntos en tu %s.';
$txt['exit_send_points'] = ' Puntos enviados exitosamente.';
$txt['already_gave_points'] = 'Ya haz dado puntos a este tema.';
$txt['no_points_topics'] = 'Nadie a dado puntos a este tema.';
$txt['points_in_topics'] = 'Dieron puntos a este tema';
$txt['skm_points'] = ' Puntos';
$txt['skm_views'] = ' Visitas';
$txt['skm_coment'] = ' Comentario';
$txt['skm_coments'] = ' Comentarios';
$txt['skm_book'] = ' Favoritos';
$txt['skm_send'] = 'Enviar';
$txt['skm_send_points'] = 'Dar puntos';
$txt['skm_add_book'] = 'Agregar a favoritos';
$txt['skm_report_topic'] = 'Reportar este tema';
$txt['skm_share_topic'] = 'Compartir este tema';
$txt['skm_digg'] = 'En digg';
$txt['skm_twit'] = 'En twitter';
$txt['skm_face'] = 'En facebook';
$txt['skm_deli'] = 'En delicius';
//End Custom SMF Shop


12.- Agregan al final del Index.css del tema que usan:


Code: [Select]
/* Custom shop */
.share_topic, .tools_post .floatleft li, .tools_post .floatright li {
   display: block;
   float: left; }
   
.share_topic span, .coments span, .tools_post .floatright li span {
    font-size: 14px;
   font-weight: bold; }
   
.disblock {
    display: block; }
   
.over {
    overflow: hidden; }
   
.share_topic {
   padding-top: 5px; }
   
.share_topic span {
    line-height: 32px;
   margin-right: 5px; }
   
.coments {
    background: url(../images/sprite_shop.png) no-repeat 2px -426px;
   font-weight: bold;
   padding-left: 45px;
   height: 30px;
   line-height: 30px; }
   
.tools_post {
    text-align: right;
   font-size: 11px;
   font-family: arial; }
   
.tools_post .floatleft li {
   margin: 3px !important; }
   
.tools_post .floatleft li.buttons, .tools_post input, .tools_post input:hover {
    background: #FBFBFB url(../images/bg.png) repeat-x bottom left;
    border: 1px solid #7F9DB9;
    border-radius: 3px;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px; }
   
.tools_post input, .tools_post input:hover {
    background: #FBFBFB url(../images/bg.png) repeat-x bottom left;
   cursor: pointer;
   cursor: hand; }
   
.tools_post .floatleft li a {
    background: url(../images/sprite_shop.png) no-repeat 2px -242px;
   text-decoration: none;
   font-weight: bold;
    display: block;
    line-height: 22px;
   padding: 0 5px 0 25px;
    height:22px; }
   
.tools_post .floatleft li a:hover {
    color: green; }
   
.tools_post .floatleft li a.book {
    background: url(../images/sprite_shop.png) no-repeat 2px -320px; }
   
.tools_post select, .tools_post input, .tools_post input:hover {
    line-height: 17px; }
   
.tools_post .floatright {
   padding: 0 5px 5px 5px; }
   
.tools_post .floatright li {
   margin-right: 10px !important;
   background: url(../images/sprite_shop.png) no-repeat top left;
   padding-top: 23px !important;
   font-weight: 600; }
   
.tools_post li.views {
    background-position: 0 -77px; }
   
.tools_post li.totalbook {
    background-position: 0 -154px; }
   
.tools_post div.floatleft {
   width: 55%;
   text-align: left; }
   
/* End Custom shop */

Descomprimen las imágenes adjuntadas,y suban las a la carpeta images del tema que usa.

Suban el php adjunto, al root de su foro, y ejecutenlo de esta forma.


Code: [Select]
www.miforo.com/db_custom_shop.phpSi todo sale bien, les saldra una pantalla en blanco.





Nota:
El recuento de los puntos al tema, se harán recién desde que hagan esta modificación.


Hecho por zutzu
You do not have permission to give points
point 3 Points

Users who gave points in this topic » EduardO (3 Pts) 

no avatar
Usuario: rams15
Rango: Recién Llegada
Mensajes: 3
Points: 0
Mi web: no tengo
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #1 June 25, 2011 - 08:50 20:50
ajam y los creditos donde quedaron?

Usuario: Diegorixo
Rango: Nuevo Usuario
Mensajes: 502
Points: 9
Mi web: http://www.stickplays.net/foro
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #2 June 25, 2011 - 08:54 20:54
Créditos?

Yo veo claramente que dice

Quote
Hecho por zutzu

no avatar
Usuario: rams15
Rango: Recién Llegada
Mensajes: 3
Points: 0
Mi web: no tengo
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #3 June 25, 2011 - 08:58 20:58
pero no devio aver dejado la fuente?
osea lo hizo zutzu y ya? yo creo que debe dejar la fuente

Usuario: Diegorixo
Rango: Nuevo Usuario
Mensajes: 502
Points: 9
Mi web: http://www.stickplays.net/foro
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #4 June 25, 2011 - 08:59 20:59
pero no devio aver dejado la fuente?
osea lo hizo zutzu y ya? yo creo que debe dejar la fuente

Saber quién es el verdadero autor es suficiente, ya que es obvio que en SimpleMachines lo pueden encontrar bajo dicho nombre

Usuario: Gonza
Rango: Nuevo Usuario
Mensajes: 518
Points: 18
Mi web: www.dangergamers.com
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #5 June 25, 2011 - 09:23 21:23
disculpenme por meterme ami me enseñaron a poner creditos enlanzado, capaz que el flaquito no sabia para la proxima pone creditos enlanzado si seras odiado.

PD. Ya me paso ami.

Usuario: Diegorixo
Rango: Nuevo Usuario
Mensajes: 502
Points: 9
Mi web: http://www.stickplays.net/foro
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #6 June 25, 2011 - 09:30 21:30
En este caso no le veo el chiste, puesto que va a salir Spam en la URL
Además ¿quién no conoce a zutzu?

Usuario: Gonza
Rango: Nuevo Usuario
Mensajes: 518
Points: 18
Mi web: www.dangergamers.com
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #7 June 25, 2011 - 09:55 21:55
En este caso no le veo el chiste, puesto que va a salir Spam en la URL
Además ¿quién no conoce a zutzu?

Viejo es por el trabajo, tiene que ir enlanzado a lean o cualquiera de smfsimple que cree tutoriales no le gustarian que usen  sus tutus Sin creditos enlanzados y creo que no es spam son web amigas. Es mi humilde opinion.

no avatar
Usuario: rams15
Rango: Recién Llegada
Mensajes: 3
Points: 0
Mi web: no tengo
Perfil: View Profile
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #8 June 25, 2011 - 10:43 22:43
yo comparto la idea de gonza

Usuario: Maliante
Rango: Friend de SMFSimple
Mensajes: 1361
Points: 181
Mi web: http://www.ftasupport.info
Perfil: View Profile
Pais:
pr
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #9 June 25, 2011 - 10:53 22:53
Yo creo q muchos tutos que e creado simplemente agrego el nick del creador y es suficiente.

Aparte Zutzu es parte de smfsimple. Si no fuera parte del foro se podia dejar el link a su foro pero es parte del foro y tiene el nombre del creador.

Para mi es suficiente credito.

Saludos
Maliante

Usuario: Lean
Rango: Fundador
Mensajes: 6782
Points: 236
Perfil: View Profile
Pais:
ar
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #10 June 25, 2011 - 11:53 23:53
yo comparto la idea de gonza
Aparte, derrepente aparece un usuario con 3 mensajes a quejarse de otro usuario? raro no?

Usuario: Maliante
Rango: Friend de SMFSimple
Mensajes: 1361
Points: 181
Mi web: http://www.ftasupport.info
Perfil: View Profile
Pais:
pr
Re:SMF Shop estilo webs linksharing (Puntos al tema)
Reply #11 June 26, 2011 - 12:08 00:08
Raro es algo bonito para decir lo q yo diria.

tiene 3 mensajes y los 3 son quejandose de credito. Al menos hubiese saluudado antes de quejarse y sin fundamento.

El credito fue dejado y cumple con el minimo de credito exigido

Tema del credito cerrado al q no le agrade que haga sus propios Tutos en sus foros y deje los creditos como les agrade. El usuario cumplio la regla.

Saludos
Maliante

 

TAGS



top

Smfsimple.com es un sitio destinado a brindar un servicio de soporte y herramientas para foros realizados con el sistema de foros gratuito simplemachines.org. Contamos con un selecto equipo de desarrolladores y conocedores del sistema, sus foros estaran en buenas manos.
This site is not affiliated with or endorsed by Simple Machines