query_posts('paged='.get_query_var('paged').'&cat=<idкатегории>');
<div id="field">
<input value="1">
<input value="a">
<input value="3">
<input value="b">
<textarea>5</textarea>
<button value="66">Кнопка</button>
</div>
<div id="result"></div>
var result = $('#field textarea, input, button').map(function() {
return $(this).val()
}).get().join(', ');
$('#result').html(result);
setcookie ($name, $value, $expire, $path, null, null, true);
$('form').live('submit', function(){
//сюды отправку формы
)}
while($post=mysql_fetch_array($q)){
$result .= "<form action='' method='post'>
<input type='hidden' name='seat' value='".$post['id']."'>
<input type='hidden' name='select' value='".$lp['id']."'>
<input type='submit' value='Забрать' class='btn_small'>
</form>";
return json_decode('result' => $result, 'response' => true)
}
success: function(data) {
var res = JSON.stringify(data);
if (res.response == '1'){
//делаем что тос res.result
}
function translit($from) {
$to = array(
'a' => 'а', 'b' => 'б', 'v' => 'в',
'g' => 'г', 'd' => 'д', 'e' => 'е',
'zh' => 'ж', 'z' => 'з', 'i' => 'и',
'й' => 'y', 'к' => 'k', 'l' => 'л',
);
return strtr($from, $to);
}
$sql->select("(SELECT COUNT(*) c FROM news
WHERE news.author = '$user_name') newscount
, (SELECT COUNT(*) c
FROM torrents
WHERE torrents.user = '$user_name') torrcount
,users.date AS userdate
,users.rep AS userrep
,torrents.title AS Item_Title
,torrents.torrent AS Item_link
,'torrent' AS Item_Type",
"users",
"INNER JOIN torrents ON users.name = torrents.user
WHERE users.name = '$user_name'
LIMIT 0, 30");
$sql->select("news.link AS Item_link,
news.title AS Item_Title
, 'news' AS Item_Type",
"users",
"INNER JOIN news ON users.name= news.author
WHERE users.name = '$user_name'
LIMIT 0, 30");
SELECT
@ncount := (
SELECT COUNT(*) c
FROM news
WHERE news.author = '$user_name'
) newscount
, @tcount := (
SELECT COUNT(*) c
FROM torrents
WHERE torrents.user = '$user_name'
) torrcount
, users.DATE AS userdate
, users.rep AS userrep
, torrents.title AS Item_Title
, torrents.torrent AS Item_link
, 'torrent' AS Item_Type
FROM users
INNER JOIN torrents ON users.name = torrents.user
WHERE users.name = '$user_name'
UNION ALL
SELECT
@ncount newscount
, @tcount torrcount
, users.DATE AS userdate
, users.rep AS userrep
, news.link AS Item_Title
, news.title AS Item_link
, 'news' AS Item_Type
FROM users
INNER JOIN news ON users.name= news.author
WHERE users.name = '$user_name'
LIMIT 0, 30