Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Reikia scripto

Parašė NikeAdidas· 2008 Bir. 22 11:06:49
#1

Sveiki reikai skripto kad negaletu paspaust ant nario vardo panasei kaip pagalbos robotukas??:?

Parašė ibodom· 2008 Bir. 22 11:06:02
#2

Tai gal išimk nuorodą ir pakeisk ją paprastu tekstu ?

Parašė LeBro· 2008 Bir. 22 11:06:38
#3

xemxis parašė:
Tai gal išimk nuorodą ir pakeisk ją paprastu tekstu ?


nenusisnekek...tada nesispaus nei ant vieno nario, o jis, kaip supratau, nori, kad tik ant kazkokio vieno nario neveiktu linkas...
su if kazka bandyk daryt

Parašė NikeAdidas· 2008 Bir. 22 11:06:00
#4

Man ir reikia kad neitu paspaust nei ant vieno nario kaip ant pagalbos robotuko :?

Redagavo NikeAdidas· 2008 Rugp. 29 13:08:57

Parašė ibodom· 2008 Bir. 22 11:06:08
#5

O tu čia nešvepluok :D Visų pirmą jis nepasakė, kad nori tik , kad ant vieno vardo neitų paspausti. O jei taip tai žinoma, tik su if .

EDIT: Xa sakiau, norėjai būti kietas , o išėjo kaip visada :D ( 4LeBro ).
EDIT2: NikeAdidas, tau tinka pirmojo mano posto variantas.

Redagavo ibodom· 2008 Bir. 22 11:06:51

Parašė NikeAdidas· 2008 Bir. 22 11:06:10
#6

Tai kaip du pestukai a ? :D

Parašė LeBro· 2008 Bir. 22 11:06:51
#7

nu tokiu atveju elementaru viskas, bet daug darbo bus

Parašė ibodom· 2008 Bir. 22 12:06:01
#8

Jau parašiau :[ Pasiredaguok failą kur tau nereikia, kad neitų spausti ant nario vardo, iš nuorodos, palik tik jos pavadinimo tekstą, ir bus nepaspaudžiamasis vardas ;)

Redagavo ibodom· 2008 Bir. 22 12:06:01

Parašė NikeAdidas· 2008 Bir. 22 12:06:18
#9

tai turbut profile.php redaguot ?

Parašė ibodom· 2008 Bir. 22 12:06:51
#10

Tai gal ne :D, nes profile.php jau atidarytas profilis, tau reikia tada shoutbox, online users panelių failus redaguoti, dar news.php, jei nenori, kad ant naujienos autoriaus neitų paspausti .

Redagavo ibodom· 2008 Bir. 22 12:06:25

Parašė NikeAdidas· 2008 Bir. 22 12:06:53
#11

Daug darbelio B)

Parašė bruzgis· 2008 Bir. 22 12:06:46
#12

Labai paprasta...


if ($data['user_id'] != "1" )
   {
      $vartotojas = "<a href='".BASEDIR."profile.php?lookup'".$data['user_id']."'>".$data['user_name']."</a>";
    }
else
    {
        $vartotojas = "".$data['user_name']."";     
   }

echo $vartotojas;





Kur paryskinta pasikeisk i norimo vartotojo id, tada sita koda iterpk i shoutboxa ir ten kur eina prie pranesimo vartotojo vardas, ji pakeisk $vartotojas. Arba prisek shoutboxa padesiu...

aaa... sita viska reiktu daryt visuose failuose, kuriuose nenori kad paspaustu... arba tiesiog i profile.php uzmest redirekta jeigu lookup=tamtikras id

Parašė ibodom· 2008 Bir. 22 12:06:41
#13

chipass parašė:
Labai paprasta...


if ($data['user_id'] != "1" )
   {
      $vartotojas = "<a href='".BASEDIR."profile.php?lookup'".$data['user_id']."'>".$data['user_name']."</a>";
    }
else
    {
        $vartotojas = "".$data['user_name']."";     
   }

echo $vartotojas;





Kur paryskinta pasikeisk i norimo vartotojo id, tada sita koda iterpk i shoutboxa ir ten kur eina prie pranesimo vartotojo vardas, ji pakeisk $vartotojas. Arba prisek shoutboxa padesiu...


Jis nori, kad visų vartotojų neitų paspausti. Daug darbo tikrai :D

Parašė bruzgis· 2008 Bir. 22 12:06:03
#14

Visų vartotojų? tai tiesiog nuimt tereik linkus ir viskas....

o jei paprasčiau padaryt kad kurio nors vartotojo negalėtų peržiūrėt profilio, tai

<?
if ($lookup = "1" )
   {
      echo "<center>Šis vartotojas savo profilio neturi, prašome grįžti į <a href='".BASEDIR."index.php'>pradžią</a></center>";
    }
else
    {
      /*visas profilio kodas....*/
     //tada gale prie requore_once...*
   }
   
?>



Parašė NikeAdidas· 2008 Bir. 22 14:06:59
#15

o butent kokius linkus nuimti man erorus meto :?

Parašė MAnjack· 2008 Bir. 23 18:06:40
#16

Šitą:
if (!isset($lookup) || !isNum($lookup)) fallback("index.php");




Keisk į:
if ($lookup ='1' || !isset($lookup) || !isNum($lookup)) fallback("index.php");




profile.php faile čia jeigu ką.

Redagavo MAnjack· 2008 Bir. 24 09:06:07

Parašė tofy· 2008 Bir. 23 18:06:49
#17

MAnjack smile išjunk

Redagavo tofy· 2008 Bir. 23 18:06:09

Parašė NikeAdidas· 2008 Bir. 23 18:06:08
#18

Tai reiks pabandyt taip suprasiu db mazdaug :)

Parašė NikeAdidas· 2008 Bir. 24 03:06:26
#19

o galima padaryt kad isvis nario nikas nebutu nuoroda ? :?

Parašė Paranoja· 2008 Bir. 24 08:06:09
#20

Nu tai tau jau aiškina reikės visus failus redaguot , kuriuose nenori matyti to linko jei shoutboxe tai shoutboxe susirandi <a href='profile......'>$userinfo['user_name']</a> ir trini , taip iš visų failų ...

Parašė MAnjack· 2008 Bir. 24 09:06:23
#21

Šiaip galima parašyt funkciją, kuri linkus į profilį darytų, bet į admin nepraleistų. Jeigu kam reikės galėsiu padaryt, bet failus vistiek reikės redaguoti. Gal net daugiau.

Parašė NikeAdidas· 2008 Bir. 27 22:06:27
#22

Galit pvz parodyt nes as darau ir man eror
Cia profile.php


<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: profile.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."view_profile.php";
include LOCALE.LOCALESET."user_fields.php";

if (!isset($_GET['group_id']) || !isnum($_GET['group_id'])) {
   
   if (!isset($_GET['lookup']) || !isnum($_GET['lookup'])) { redirect("index.php"); }
   
   $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='".$_GET['lookup']."'");
   
   if (dbrows($result)) { $user_data = dbarray($result); } else { redirect("index.php"); }
   
   if ($user_data['user_status'] > "0") { redirect("index.php"); }
   
   if (iADMIN && checkrights("UG") && $user_data['user_id'] != $userdata['user_id']) {
      if ((isset($_POST['add_to_group'])) && (isset($_POST['user_group']) && isnum($_POST['user_group']))) {
          if (!preg_match("(^\.{$_POST['group_id']}$|\.{$_POST['group_id']}\.|\.{$_POST['group_id']}$)", $user_data['user_groups'])) {
            $result = dbquery("UPDATE ".DB_USERS." SET user_groups='".$user_data['user_groups'].".".$_POST['user_group']."' WHERE user_id='".$user_data['user_id']."'");
         }
         redirect(FUSION_SELF."?lookup=".$user_data['user_id']);
      }
   }
   
   add_to_title($locale['global_200'].$locale['400'].$locale['global_201'].$user_data['user_name']);
   opentable($locale['400']);
   echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
   if ($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar'])) {
      echo "<td rowspan='5' width='1%' class='tbl'><img src='".IMAGES."avatars/".$user_data['user_avatar']."' alt='' /></td>\n";
   }
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u001']."</td>\n";
   echo "<td align='right' class='tbl1'>".$user_data['user_name']."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'></td>\n";
   echo "<td align='right' class='tbl1'>".getuserlevel($user_data['user_level'])."</td>\n";
   echo "</tr>\n";
   if ($user_data['user_hide_email'] != "1" || iADMIN) {
      echo "<tr>\n";
      echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u005']."</td>\n";
      echo "<td align='right' class='tbl1'>".hide_email($user_data['user_email'])."</td>\n";
      echo "</tr>\n";
   }
   echo "<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u040']."</td>\n";
   echo "<td align='right' class='tbl1'>".showdate("longdate", $user_data['user_joined'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u041']."</td>\n";
   echo "<td align='right' class='tbl1'>".($user_data['user_lastvisit'] ? showdate("longdate", $user_data['user_lastvisit']) : $locale['u042'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td colspan='".($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar']) ? "3" : "2")."' class='tbl2' style='text-align:center;white-space:nowrap'><a href='messages.php?msg_send=".$user_data['user_id']."' title='".$locale['u043']."'>".$locale['u043']."</a></td>\n";
   echo "</tr>\n</table>\n";
   
   echo "<div style='margin:5px'></div>\n";

   $profile_method = "display"; $i = 0; $user_fields_output = array("", "", "", ""); $ob_active = false;
   
   $result2 = dbquery("SELECT * FROM ".DB_USER_FIELDS." ORDER BY field_group, field_order");
   if (dbrows($result2)) {
      while($data2 = dbarray($result2)) {
         if ($i != $data2['field_group']) {
            if ($ob_active) {
               $user_fields_output[$i] = ob_get_contents();
               ob_end_clean();
               $ob_active = false;
            }
            $i = $data2['field_group'];
         }
         if (!$ob_active) {
            ob_start();
            $ob_active = true;
         }
         if (file_exists(LOCALE.LOCALESET."user_fields/".$data2['field_name'].".php")) {
            include LOCALE.LOCALESET."user_fields/".$data2['field_name'].".php";
         }
         if (file_exists(INCLUDES."user_fields/".$data2['field_name']."_include.php")) {
            include INCLUDES."user_fields/".$data2['field_name']."_include.php";
         }
      }
   }
   
   if ($ob_active) {
      $user_fields_output[$i] = ob_get_contents();
      ob_end_clean();
   }
   
   if (array_key_exists(1, $user_fields_output) && $user_fields_output[1]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u044']."</strong></td>\n";
      echo "</tr>\n".$user_fields_output[1];      
      echo "</table>\n";
   }
   
   if (array_key_exists(2, $user_fields_output) && $user_fields_output[2]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u045']."</strong></td>\n";
      echo "</tr>\n".$user_fields_output[2];      
      echo "</table>\n";
   }
   
   if (array_key_exists(4, $user_fields_output) && $user_fields_output[4]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u047']."</strong></td>\n";
      echo "</tr>\n".$user_fields_output[4];      
      echo "</table>\n";
   }
   
   if (iADMIN && checkrights("M")) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u048']."</strong></td>\n";
      echo "</tr>\n<tr>\n";      
      echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u049']."</td>\n";
      echo "<td align='right' class='tbl1'>".$user_data['user_ip']."</td>\n";
      echo "</tr>\n</table>\n";
   }

   if ($user_data['user_groups']) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='center tbl-border'>\n<tr>\n";
      echo "<td class='tbl2'><strong>".$locale['401']."</strong></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl1'>\n";
      $user_groups = (strpos($user_data['user_groups'], ".") == 0 ? explode(".", substr($user_data['user_groups'], 1)) : explode(".", $user_data['user_groups']));
      for ($i = 0; $i < count($user_groups); $i++) {
         echo "<div style='float:left'><a href='".FUSION_SELF."?group_id=".$user_groups[$i]."'>".getgroupname($user_groups[$i])."</a></div><div style='float:right'>".getgroupname($user_groups[$i], true)."</div><div style='float:none;clear:both'></div>\n";
      }
      echo "</td>\n</tr>\n</table>\n";
   }
   if (iADMIN && checkrights("M") && $user_data['user_id'] != $userdata['user_id']) {
      $user_groups_opts = "";
      if ($user_data['user_level'] < 102) {
         echo "<div style='margin:5px'></div>\n";
         echo "<form name='admin_form' method='post' action='".FUSION_SELF."?lookup=".$user_data['user_id']."'>\n";
         echo "<table cellpadding='0' cellspacing='0' width='400' class='center tbl-border'>\n<tr>\n";
         echo "<td class='tbl2' colspan='2'><strong>".$locale['402']."</strong></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td class='tbl1'>\n";
         echo "<a href='".ADMIN."members.php".$aidlink."&amp;step=edit&amp;user_id=".$user_data['user_id']."'>".$locale['410']."</a> ::\n";
         echo "<a href='".ADMIN."members.php".$aidlink."&amp;step=ban&amp;act=on&amp;user_id=".$user_data['user_id']."&amp;status=1' onclick=\"return confirm('".$locale['413']."');\">".$locale['411']."</a> ::\n";
         echo "<a href='".ADMIN."members.php".$aidlink."&amp;step=delete&amp;status=0&amp;user_id=".$user_data['user_id']."' onclick=\"return confirm('".$locale['414']."');\">".$locale['412']."</a></td>\n";
         $result = dbquery("SELECT * FROM ".DB_USER_GROUPS." ORDER BY group_id ASC");
         if (dbrows($result)) {
            while ($data2 = dbarray($result)) {
               if (!preg_match("(^\.{$data2['group_id']}|\.{$data2['group_id']}\.|\.{$data2['group_id']}$)", $user_data['user_groups'])) {
                  $user_groups_opts .= "<option value='".$data2['group_id']."'>".$data2['group_name']."</option>\n";
               }
            }
            if (iADMIN && checkrights("UG") && $user_groups_opts) {
               echo "<td align='right' class='tbl1'>".$locale['415']."\n";
               echo "<select name='user_group' class='textbox' style='width:100px'>\n".$user_groups_opts."</select>\n";
               echo "<input type='submit' name='add_to_group' value='".$locale['416']."' class='button'  onclick=\"return confirm('".$locale['417']."');\" /></td>\n";
            }
         }
         echo "</tr>\n</table>\n</form>\n";
      }
   }
} else {
   $result = dbquery("SELECT * FROM ".DB_USER_GROUPS." WHERE group_id='".$_GET['group_id']."'");
   if (dbrows($result)) {
      $data = dbarray($result);
      $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$') ORDER BY user_level DESC, user_name");
      opentable($locale['420']);
      echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
      echo "<td align='center' colspan='2' class='tbl1'><strong>".$data['group_name']."</strong> (".sprintf((dbrows($result) == 1 ? $locale['421'] : $locale['422']), dbrows($result)).")</td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl2'><strong>".$locale['423']."</strong></td>\n";
      echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['424']."</strong></td>\n";
      echo "</tr>\n";
      while ($data = dbarray($result)) {
         $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;
         echo "<tr>\n<td class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
         echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getuserlevel($data['user_level'])."</td>\n</tr>";
      }
      echo "</table>\n";
   } else {
      redirect("index.php");
   }
}
closetable();

require_once THEMES."templates/footer.php";
?>




Redagavo NikeAdidas· 2008 Bir. 27 22:06:41

Parašė Gugiss· 2008 Bir. 30 12:06:25
#23

reikia shoutbox_panel.php :[

Parašė NikeAdidas· 2008 Rugp. 10 10:08:25
#24

pavyzdžiui news.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";

if (isset($readmore) && !isNum($readmore)) fallback(FUSION_SELF);

// Predefined variables, do not edit these values
if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }

// This number should be an odd number to keep layout tidy
$items_per_page = 11;

if (!isset($readmore)) {
   $rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
   if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
   if ($rows != 0) {
      $result = dbquery(
         "SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
         LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
         LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
         WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT $rowstart,$items_per_page"
      );      
      $numrows = dbrows($result);
      if ($settings['news_style'] == "1") $nrows = round((dbrows($result) - 1) / 2);
      while ($data = dbarray($result)) {
         $news_cat_image = "";
         $news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
         if ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
         } else {
            $news_cat_image = "";
         }
         $news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
         if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "news_date" => $data['news_datestamp'],
            "news_ext" => $data['news_extended'] ? "y" : "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
            "news_allow_comments" => $data['news_allow_comments']
         );
         if ($settings['news_style'] == "1") {
            if ($rows <= 2 || $ncount == 1) {
               $news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
               $news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
               $news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
               $news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
               if (iSUPERADMIN && checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&amp;news_id=".$news_info['news_id']."'>\n";
               $news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date'])." &middot;\n";
               if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
                  $news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> &middot;\n" : "";
                  $news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> &middot;\n" : "";
                  $news_[0] .= $news_info['news_reads'].$locale['044']." &middot;\n";
               }
               $news_[0] .= "<a href='print.php?type=N&amp;item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
               if (iSUPERADMIN && checkrights("N")) { $news_[0] .= " &middot; <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[0] .= "</span>\n"; }
               $news_[0] .= "</td>\n</tr>\n</table>\n";
               if ($ncount != $rows) $news_[0] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
            } else {
               if ($i == $nrows && $ncolumn != 2) { $ncolumn = 2; $i = 0; }
               $row_color = ($rc % 2 == 0 ? "tbl2" : "tbl1");
               $news_[$ncolumn] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
               $news_[$ncolumn] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
               $news_[$ncolumn] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
               $news_[$ncolumn] .= "<tr>\n<td align='center' class='tbl2'>\n";
               if (iSUPERADMIN && checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&amp;news_id=".$news_info['news_id']."'>\n";
               $news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date']);
               if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
                  $news_[$ncolumn] .= "<br>\n";
                  $news_[$ncolumn] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> &middot;\n" : "";
                  $news_[$ncolumn] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> &middot;\n" : "";
                  $news_[$ncolumn] .= $news_info['news_reads'].$locale['044']." &middot;\n";
               } else {
                  $news_[$ncolumn] .= " &middot;\n";
               }
               $news_[$ncolumn] .= "<a href='print.php?type=N&amp;item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
               if (iSUPERADMIN && checkrights("N")) { $news_[$ncolumn] .= " &middot; <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[$ncolumn] .= "</span>\n"; }
               $news_[$ncolumn] .= "</td>\n</tr>\n</table>\n";
               if ($ncolumn == 1 && $i < ($nrows - 1)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
               if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
               $i++; $rc++;
            }
            $ncount++;
         } else {
            render_news($news_subject, $news_news, $news_info);
            if ($i != $numrows) { tablebreak(); } $i++;
         }
      }
      if ($settings['news_style'] == "1") {
         opentable($locale['046']);
         echo "<table cellpadding='0' cellspacing='0' style='width:100%'>\n<tr>\n<td colspan='3' style='width:100%'>\n";
         echo $news_[0];
         echo "</td>\n</tr>\n<tr>\n<td style='width:50%;vertical-align:top;'>\n";
         echo $news_[1];
         echo "</td>\n<td style='width:10px'><img src='".THEME."images/blank.gif' alt='' width='10' height='1'></td>\n<td style='width:50%;vertical-align:top;'>\n";
         echo $news_[2];
         echo "</td>\n</tr>\n</table>\n";
         closetable();
      }
      if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$items_per_page,$rows,3)."\n</div>\n";
   } else {
      opentable($locale['046']);
      echo "<center><br>\n".$locale['047']."<br><br>\n</center>\n";
      closetable();
   }
} else {
   include INCLUDES."comments_include.php";
   include INCLUDES."ratings_include.php";
   $result = dbquery(
      "SELECT tn.*, user_id, user_name FROM ".$db_prefix."news tn
      LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
      WHERE news_id='$readmore'"
   );
   if (dbrows($result)!=0) {
      $data = dbarray($result);
      if (checkgroup($data['news_visibility'])) {
         $news_cat_image = "";
         if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
             $result2 = dbquery("UPDATE ".$db_prefix."news SET news_reads=news_reads+1 WHERE news_id='$readmore'");
             $data['news_reads']++;
         }
         $news_subject = $data['news_subject'];
         if ($data['news_cat'] != 0) {
            $result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats WHERE news_cat_id='".$data['news_cat']."'");
            if (dbrows($result2)) {
               $data2 = dbarray($result2);
               $news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'><img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
            }
         }
         $news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
         if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
         if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "news_date" => $data['news_datestamp'],
            "news_ext" => "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
            "news_allow_comments" => $data['news_allow_comments']
         );
         render_news($news_subject, $news_news, $news_info);
         if ($data['news_allow_comments']) showcomments("N","news","news_id",$readmore,FUSION_SELF."?readmore=$readmore");
         if ($data['news_allow_ratings']) showratings("N",$readmore,FUSION_SELF."?readmore=$readmore");
      } else {
         redirect(FUSION_SELF);
      }
   } else {
      redirect(FUSION_SELF);
   }
}

require_once "side_right.php";
require_once "footer.php";
?>



Ir jai galit paryskinkit kokia eilutes keitete ačiū

Parašė Qrmiz· 2008 Rugp. 10 10:08:47
#25

Va taip parašyk, ir nebus linkų:

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";

if (isset($readmore) && !isNum($readmore)) fallback(FUSION_SELF);

// Predefined variables, do not edit these values
if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }

// This number should be an odd number to keep layout tidy
$items_per_page = 11;

if (!isset($readmore)) {
   $rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
   if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
   if ($rows != 0) {
      $result = dbquery(
         "SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
         LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
         LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
         WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT $rowstart,$items_per_page"
      );      
      $numrows = dbrows($result);
      if ($settings['news_style'] == "1") $nrows = round((dbrows($result) - 1) / 2);
      while ($data = dbarray($result)) {
         $news_cat_image = "";
         $news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
         if ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
         } else {
            $news_cat_image = "";
         }
         $news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
         if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "news_date" => $data['news_datestamp'],
            "news_ext" => $data['news_extended'] ? "y" : "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
            "news_allow_comments" => $data['news_allow_comments']
         );
         if ($settings['news_style'] == "1") {
            if ($rows <= 2 || $ncount == 1) {
               $news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
               $news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
               $news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
               $news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
               if (iSUPERADMIN && checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&amp;news_id=".$news_info['news_id']."'>\n";
               $news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> ".$news_info['user_name']." ".$locale['041'].showdate("longdate", $news_info['news_date'])." &middot;\n";
               if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
                  $news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> &middot;\n" : "";
                  $news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> &middot;\n" : "";
                  $news_[0] .= $news_info['news_reads'].$locale['044']." &middot;\n";
               }
               $news_[0] .= "<a href='print.php?type=N&amp;item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
               if (iSUPERADMIN && checkrights("N")) { $news_[0] .= " &middot; <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[0] .= "</span>\n"; }
               $news_[0] .= "</td>\n</tr>\n</table>\n";
               if ($ncount != $rows) $news_[0] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
            } else {
               if ($i == $nrows && $ncolumn != 2) { $ncolumn = 2; $i = 0; }
               $row_color = ($rc % 2 == 0 ? "tbl2" : "tbl1");
               $news_[$ncolumn] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
               $news_[$ncolumn] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
               $news_[$ncolumn] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
               $news_[$ncolumn] .= "<tr>\n<td align='center' class='tbl2'>\n";
               if (iSUPERADMIN && checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&amp;news_id=".$news_info['news_id']."'>\n";
               $news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> ".$locale['041'].showdate("longdate", $news_info['news_date']);
               if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
                  $news_[$ncolumn] .= "<br>\n";
                  $news_[$ncolumn] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> &middot;\n" : "";
                  $news_[$ncolumn] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> &middot;\n" : "";
                  $news_[$ncolumn] .= $news_info['news_reads'].$locale['044']." &middot;\n";
               } else {
                  $news_[$ncolumn] .= " &middot;\n";
               }
               $news_[$ncolumn] .= "<a href='print.php?type=N&amp;item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
               if (iSUPERADMIN && checkrights("N")) { $news_[$ncolumn] .= " &middot; <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[$ncolumn] .= "</span>\n"; }
               $news_[$ncolumn] .= "</td>\n</tr>\n</table>\n";
               if ($ncolumn == 1 && $i < ($nrows - 1)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
               if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
               $i++; $rc++;
            }
            $ncount++;
         } else {
            render_news($news_subject, $news_news, $news_info);
            if ($i != $numrows) { tablebreak(); } $i++;
         }
      }
      if ($settings['news_style'] == "1") {
         opentable($locale['046']);
         echo "<table cellpadding='0' cellspacing='0' style='width:100%'>\n<tr>\n<td colspan='3' style='width:100%'>\n";
         echo $news_[0];
         echo "</td>\n</tr>\n<tr>\n<td style='width:50%;vertical-align:top;'>\n";
         echo $news_[1];
         echo "</td>\n<td style='width:10px'><img src='".THEME."images/blank.gif' alt='' width='10' height='1'></td>\n<td style='width:50%;vertical-align:top;'>\n";
         echo $news_[2];
         echo "</td>\n</tr>\n</table>\n";
         closetable();
      }
      if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$items_per_page,$rows,3)."\n</div>\n";
   } else {
      opentable($locale['046']);
      echo "<center><br>\n".$locale['047']."<br><br>\n</center>\n";
      closetable();
   }
} else {
   include INCLUDES."comments_include.php";
   include INCLUDES."ratings_include.php";
   $result = dbquery(
      "SELECT tn.*, user_id, user_name FROM ".$db_prefix."news tn
      LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
      WHERE news_id='$readmore'"
   );
   if (dbrows($result)!=0) {
      $data = dbarray($result);
      if (checkgroup($data['news_visibility'])) {
         $news_cat_image = "";
         if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
             $result2 = dbquery("UPDATE ".$db_prefix."news SET news_reads=news_reads+1 WHERE news_id='$readmore'");
             $data['news_reads']++;
         }
         $news_subject = $data['news_subject'];
         if ($data['news_cat'] != 0) {
            $result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats WHERE news_cat_id='".$data['news_cat']."'");
            if (dbrows($result2)) {
               $data2 = dbarray($result2);
               $news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'><img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
            }
         }
         $news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
         if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
         if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "news_date" => $data['news_datestamp'],
            "news_ext" => "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
            "news_allow_comments" => $data['news_allow_comments']
         );
         render_news($news_subject, $news_news, $news_info);
         if ($data['news_allow_comments']) showcomments("N","news","news_id",$readmore,FUSION_SELF."?readmore=$readmore");
         if ($data['news_allow_ratings']) showratings("N",$readmore,FUSION_SELF."?readmore=$readmore");
      } else {
         redirect(FUSION_SELF);
      }
   } else {
      redirect(FUSION_SELF);
   }
}

require_once "side_right.php";
require_once "footer.php";
?>



Parašė NikeAdidas· 2008 Rugp. 10 17:08:47
#26

Yra vistiek linkas :?