|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
3 f% M3 u, E, |" l// Theme Option
" c3 s! A& p4 O) p* y5 n8 W+ e' K////////////////////////////////////////////////////////////////////////////////
/ r7 J2 O1 N, Y2 Z. }
1 L2 T% I, ?# Y9 S$themename = "Zenx";
/ G4 X' u/ F( G. E3 E5 e$shortname = str_replace(' ', '_', strtolower($themename));4 V8 w2 j+ L# J& n! d% F3 V
, M- i" T# ?$ ?& u: z: m
function get_theme_option($option)' C% u( Z/ u7 ^+ R) j0 r) S/ }
{
, b H9 A& ]6 }' f8 b global $shortname;
$ M% h( f f2 W4 ` Y% e( x return stripslashes(get_option($shortname . '_' . $option));" F8 _5 R* a. Q% H+ W# E6 y! M
}9 a+ U6 Y% ]( D8 S- ]+ @( ~
$ a% v9 Q" b; f% _6 v# |# Lfunction get_theme_settings($option)
6 m2 N8 r0 R8 j" d{/ c8 Z( o% U1 C9 `6 \
return stripslashes(get_option($option));. B' ]* i; |" v; T/ b- ^
}1 o; |- T) y: N6 d
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");" i6 c9 ]# Z: Q5 }" h
$wp_getcat = array();* s0 U% k/ s+ c' z7 S5 z
foreach ($wp_dropdown_rd_admin as $category_list) {0 _) k, N9 [' @5 C. c, d8 I- K
$wp_getcat[$category_list->term_id] = $category_list->name;8 G2 r' O8 u) q( E* D
}2 S9 F0 O$ J, I Y* w0 ^8 z# B0 P
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");2 U4 m% |' \( q+ E7 Z6 O) T
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
# z# a, K1 T, X1 D# P$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");3 R2 @% J4 h6 G- _$ L
9 N- W6 d. p6 \$options = array (# l& v' z+ P" u+ W" R9 v8 K( g
1 N. z9 e( q, {( D( I
% y" ]! m! F6 S% J, x6 h% o
array( "name" => "Blog Header Settings",
; G) {1 c/ @) \) ~9 k "type" => "heading",
( c4 }! f' T# Z- R& M8 g8 }2 [" { ),
2 B- `4 d% d, }, P
3 C, I. m) l& ], V4 \. \# X; u array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 n* G, d. ^2 u; S z3 Y8 _0 ?1 Y "id" => $shortname."_header_logo_activate",
/ X) U( T4 C# u; b3 h' z "type" => "select",+ p& o- |- g' P5 \& v* g& w/ B; u! z
"std" => "No",
3 n- A& q( ]/ Q/ D "options" => array("No", "Yes")),
: r; c/ o/ s5 m( e- _0 E! z* h! n& q* X k& q8 I/ Q5 r
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",# d0 `. o+ B( i8 _
"id" => $shortname."_logo_url",
! d4 J! F$ i9 `( g' M, m "type" => "text",
" m A* z$ g+ `& C$ ^3 N2 G "box" => "social",8 F. I x, T9 b! K
"std" => "",
" d- T5 ^3 K$ N" m6 _$ n: u ),
9 F: L/ n" K8 _% ]8 J* o 0 c7 m d- H4 a( i+ D1 c" T
array( "name" => "Insert Header Banner HTML Code (Header)3 @7 }! @: K9 I) ?8 g2 x3 ~
<br /><em>*Recommended Size 468 x 60</em>& B& n) O) A9 }" D- |5 N
<br /><em>*leave blank if not use</em>",- i3 @: O8 V4 ]6 j4 ?
"id" => $shortname."_header_banner",
+ F: S1 d% a% k) k "type" => "textarea",& q: v; F8 Y% }" J3 u
"std" => "",2 L( }) o3 v! E3 W/ N6 r% s
),
, T9 H& X" |9 Y( {3 L" u
$ A! o- v, M; `7 q array( "name" => "</div></div>",
9 y# W6 _) o7 s, Q "type" => "close"," Y0 V( D1 A# p" G, L% B
),, z# W% j4 K( ~
4 [ {5 x8 `! w2 d6 a
4 N, v1 s: R, a4 V* Z array( "name" => "Header Navigation Settings",7 [' ]! v# [8 j+ V- T
"type" => "heading",8 i) p: }- R! A
),
. n6 s. ]% z1 `- `5 Z* U* V: r
. V- w2 g, A* _* ?9 Z6 [6 @+ x array( "name" => "Insert Page ID To Exclude On Header Navigation<br />: ^' i7 U9 F# t$ a/ Z5 \
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
- O& ^3 y; F2 L* f8 r% K <em>*Enter the page post ID number only</em><br />8 d& l4 k8 R% L' S O6 Y0 x* E
<em>*separate by comma</em><br />4 t3 g8 t; r# ~& n0 } E3 c) {
<em>*Exclude pages which you don't want to show on the header navigation</em>",* ^/ H/ ]" ]" \) b# h
"id" => $shortname."_header_page_navigation",
1 l; P& E: X$ d; q3 d! M "type" => "text",
, p: Q7 G1 f& B% f( e4 W8 W "std" => "",
8 D- e" J1 c7 U" B* w6 u ),; \2 j5 i3 @" B' p- w
0 @0 f! P( o! X+ [- r
array( "name" => "</div></div>",
4 @+ }- L6 v# C7 Q "type" => "close",
& `. w. R9 S8 c- c" I8 ^% Z ),4 i- K- Q) i5 v) D( @, ?" P) K) q2 c
/ n# x0 l/ R" r6 e5 [* M0 V* A( ?. S# ^9 M: z
array( "name" => "Post Auto Thumbnails Settings",$ n% ^3 j# r6 @% _
"type" => "heading", ]% |# ]7 ]* q6 N* g+ p
),2 K& m9 V$ N& {) a, i( F% V
6 M$ P" ~. l& `3 H- F' ^
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) P+ }; p" i8 Z, F7 G: M- v "id" => $shortname."_timthumb_activate",) Z# d" Z# R% ~& w, w; D7 ~
"type" => "select",
4 w7 n* ?$ j6 e "std" => "No",
/ ~, p: t$ ?- v0 Q1 x9 C8 M "options" => array("No", "Yes")),. [8 }+ d: A% O; p" F9 O. Z
" }: y* G; ^' R! d- g
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
. F$ `" w7 v' _& N "id" => $shortname."_timthumb_cropping",
F/ v& H7 h- I9 _# s "type" => "select",4 e! O7 q% ]! u
"std" => "",
1 u- ?- m1 \; p" M4 Y- k. @0 q! C# U "options" => $crop_position),
- x1 D: [/ k4 s+ \, D$ w: U: g. |; b; |4 X f: L
array( "name" => "Insert Width Of Thumbnail Image<br />
9 k+ A" B0 Q* p) S3 T0 a <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& M3 N( w+ H& }2 }( ^
<em>*Leave Blank To Use Default: 250</em><br />",
7 K# Y: x1 C. _ "id" => $shortname."_thumb_width",% V: `, ]% B z( |( P
"type" => "text",
7 g& d5 r, g: @" b "std" => "",+ g' K4 e, ~% P+ j) j* I
),
$ b! f" V4 L" b/ c0 \( o" ^5 ^4 e6 z1 X5 `. I1 W: g3 C& M
array( "name" => "Insert Height Of Thumbnail Image<br />! c! \. B! t8 `- W8 x- a9 C6 n a2 ]
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
' |0 O6 m6 T" L( d' @; t& f6 E' W <em>*Leave Blank To Use Default: 200</em><br />",
2 t- L6 Y% d" H$ g "id" => $shortname."_thumb_height",7 Z# r# c1 |, q+ m: q" t+ i' w
"type" => "text",% K; s! D4 N k8 L1 i7 j/ |7 _" h
"std" => "",
3 P7 a# M8 J) H) n w5 r% [& D )," I7 t; y3 ?; j+ M) j" M( a
9 \6 M$ \' Z7 ]6 x array( "name" => "</div></div>",2 L( h0 S0 U9 A2 Y
"type" => "close",4 j# @0 Z% O- _) [0 w$ W& ?& i s
),4 O+ z4 _* {7 y4 A- ?
- |* _2 h& B/ A. ?# y2 c array( "name" => "Featured Content Slider Settings",
, s; U x3 m3 R, y1 q( }5 W7 H "type" => "heading",
1 D; e% y d+ H. W. B: i9 B5 B ),& G+ Z+ Z8 Q6 n+ ^. k1 z3 M* _
# i6 P4 L" C6 Z1 T! e* U. s' z& Q6 k
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ _0 x5 e, y6 a7 d& ?( O, X) d
"id" => $shortname."_featured_activate",
" f2 Y: h$ N# c p: n# Y/ I "type" => "select",
' ?9 {/ y( W- w/ P2 ^, o7 q "std" => "No",/ ^0 m/ A- |* e
"options" => array("No", "Yes")),
7 @( D/ p. N- S6 g% i& P+ K6 l: Q+ R# v: g
3 E4 T& \* g/ q8 @2 \; D9 e$ R c array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
% m1 v; S7 r( ~# W+ a "id" => $shortname."_featured_category",
% M) n% \( z/ } ~) x7 t "type" => "select",
7 W4 p( g9 T& n "std" => "Choose a category:",6 e7 S. I, W0 y, s5 w/ A* a i
"options" => $wp_getcat),
! m6 E! O0 ~+ u! g: [; B) J7 a
( o* T, y- s/ b6 Z! Q array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",# e9 l G# z9 k& V
"id" => $shortname."_featured_number",
$ Z! M* ?4 v% h8 \9 }! x3 }2 r" [1 i "type" => "select",
9 W# V e' ]) `7 B: E) e "std" => "Number of post:",2 E/ X, v( R: g7 E; D) }0 y' t
"options" => $number_entries),
8 E& h/ j/ c( i1 b; ^* a0 D, R7 _. b5 [
array( "name" => "</div></div>",0 o0 l; N3 ^7 W* R
"type" => "close",
1 b0 J$ |$ c+ `1 ]$ H. l8 e ),9 _/ _) L _) w, ?5 ^
/ V+ v) T. }! B
array( "name" => "Featured Category Settings",7 F' H; }! q* U7 @
"type" => "heading",
! e, j7 a: H- H9 @& d- @9 j ),
) {5 _' w) a3 b/ a
* E. p& u- i1 }$ }% Q+ F/ O array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 ?( d+ m; M9 W8 r2 Q! {) j" @2 Q
"id" => $shortname."_featured_category_activate",) [) g+ b( g5 U* X" u- A$ A
"type" => "select",
% ]/ }) w$ S# L "std" => "No",( z/ |. n' J. w; G! q8 w
"options" => array("No", "Yes")),
# ^! \0 W7 ~4 T8 y
( j$ p0 Z' Y0 J/ Q3 W# y, O array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
+ o' n- q0 F- H; X& Y! k, u/ @ "id" => $shortname."_featured_category_id1",
' q* H& |" w5 }2 {% c m/ k* J "type" => "select",
; T: K0 y3 _7 K/ ^& W "std" => "Choose a category:",$ l1 p5 E% M, j
"options" => $wp_getcat),
* C) ~5 M0 C! ? O, E7 v% \ $ R8 `3 v F% j2 f
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",5 u4 x8 i, ?8 R9 y( T
"id" => $shortname."_featured_number1",
9 M0 S: V% [) V( h5 f- F "type" => "select",# R0 l$ j$ z: t# j. z$ I
"std" => "Number of post:"," V) U7 [& W- P) ~
"options" => $number_entries),
R8 L c8 [/ ?& B3 }2 X, c ' z1 [4 w! Q3 f7 s: i
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",% p$ g% e# i' s5 d# `* M
"id" => $shortname."_featured_category_id2",/ p L! e/ }7 X1 s: E, y- ~
"type" => "select",; K# _8 o5 b4 C( o" E: F
"std" => "Choose a category:",( |+ P+ i9 {! {9 d
"options" => $wp_getcat),+ p9 v& X( q0 {; z, G
6 G& Q1 ?8 E; C X( }( I3 {4 m( u array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, m. n3 k( K# S. a "id" => $shortname."_featured_number2",
: R& ]+ Q. A, J% W "type" => "select",
0 {- d. X1 X& B& a9 f+ Y, l "std" => "Number of post:",
6 S+ n, ~1 L! }% Q "options" => $number_entries),! M# V+ @( _ a
+ C; j& g9 G: H- d. |% } r% ~/ E6 c; J8 z
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 A p) N( P! L
"id" => $shortname."_featured_category_id3",( U# U! p8 ?: B- J4 S1 M
"type" => "select",7 X' X- p- N! ^( j( y5 O, i
"std" => "Choose a category:",
9 P4 d! u+ F& R* D5 |0 |. A "options" => $wp_getcat),- R; z1 z) u% P7 B, D) @5 v Q
" t' V! z# S8 U2 f, j8 S H% m
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
- U4 F: b$ b, Q$ L& R7 x "id" => $shortname."_featured_number3",) t- n, {' l1 p4 H* S' D
"type" => "select",- x* C; d3 b5 N. K
"std" => "Number of post:",
3 z$ G; k6 i- H9 y5 h; \ "options" => $number_entries),
$ J- w$ z; X" D% h3 M+ m! N' t: u, K0 E; L
4 D5 m$ D \7 }% b7 [5 A+ Z
array( "name" => "</div></div>",
z4 [% [0 t# R. @ "type" => "close",
9 A/ |: Q" s/ i$ ` j: l5 ~8 c) ~ ),8 k1 O {% c# F2 n. {: h- c
- q x: S! q. k0 y* ^
& d0 }) H2 t8 F: C array( "name" => "Google Adsense & Analytics Settings",% Q' V! v' ~& d4 b" j. n
"type" => "heading",
9 S: n6 h* E2 Z+ z6 O* z4 K) ^$ C3 J ),1 n- N% i' w, R2 l- P, s
7 D! _+ L( C, L$ p. c8 M
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",6 C8 U7 D& i3 z
"id" => $shortname."_adsense_loop_activate",/ g' H9 W. z! I9 V( Y7 y! U
"type" => "select",
: E& K: d+ X2 m& { "std" => "Disable",
9 t1 x1 w. H; l b$ D, n/ f "options" => array("Disable", "Enable")),
2 r- h* Y, M9 }7 ^% Y' }, i7 \
4 t0 r' q& l! W4 l' e array( "name" => "Insert Google Adsense Code For Loops Here<br />4 C7 }+ N1 `5 a8 V' I4 {
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
- H% ]1 ]/ k$ Y. d/ ]; ? "id" => $shortname."_adsense_loop",
' r2 ^. e1 \. E5 f1 F% u8 }1 U9 C "type" => "textarea",) g. P% ]- t2 h( c/ ?6 }! y
"std" => "",3 O8 _. t0 i6 J, `; X
),5 U4 Z" O7 u! M u+ `2 D. F
* f/ N6 i' Y9 f
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
E [% x; p1 g: A7 |: J "id" => $shortname."_adsense_single_activate",
5 }# w% ]9 J' A' k" { ]' m "type" => "select",6 s" \' D& J, s$ Q9 w3 o
"std" => "Disable",
1 L1 f( Z9 V: S# f) |4 F "options" => array("Disable", "Enable")),# F5 X/ F. [0 z; w* o5 L2 e
( I# _- P9 f& ^9 m$ m9 D; p% v array( "name" => "Insert Google Adsense Code For Single Page Here<br />
1 V" R. v& c' z7 Q <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
5 r1 ]0 d$ x: p4 ^2 ^ "id" => $shortname."_adsense_single", j0 \) H$ `. Y4 k9 d! Q
"type" => "textarea",
% d# t6 O4 m A4 O8 ] "std" => "",
" h$ N6 U# c& X% P1 ] ),
7 k/ n E% N7 Y0 \- i Q7 s
/ o9 R4 ]! A! M1 d
2 l5 S u0 K4 l array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",# \0 k$ m+ P1 p) y
"id" => $shortname."_google_analytics",5 }/ Y3 t5 C0 L) m1 O7 K' t( a
"type" => "textarea",
+ \, _! H; N6 U5 e! ] "std" => "",
8 N2 z2 m: n% I/ _5 x% r( j u/ M+ k) o ),
- P; I* X3 u+ b5 b
' J. v8 X @# t0 r( }/ i; G/ T array( "name" => "</div></div>",
. m; {6 a6 Q6 m) K) H1 g/ ? "type" => "close",3 [- M$ U3 H; P @
),
. r0 X: F3 _& }
4 ]& i1 S! J6 p1 y1 m* Y5 b! F! ` * b N9 w- M' C
array( "name" => "AddThis Social Bookmarking Settings",
* D, } j0 u% o. v7 ] "type" => "heading",
. A9 |3 y( _) O3 c5 H) e7 E ),
' Q7 }( k9 p, i! F
/ M4 w1 ^+ ]7 K array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
6 _+ }6 e0 e$ v" h2 Y <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",) [) S6 N: [2 K* r/ i9 Q
"id" => $shortname."_addthis",* i8 H: b0 I0 E& g9 ^
"type" => "text",9 f; O; O0 u' o
"box" => "social",' E2 Q: e7 Y5 R7 k$ i% f( l! B3 @( Z
"std" => "",1 G' \. i0 U( U; Y$ \6 i' m7 C5 h
),
5 C! Y% k' B& [3 U: ]: `6 u" W
array( "name" => "</div></div>",/ P5 V' c% O/ z1 t# }1 \
"type" => "close",
( m8 V u. B9 t+ R5 j ),7 I; c W3 R8 u v' p" F+ r+ W
1 O0 M$ _# W# L$ ?: T$ \ . j. D7 C! t- O0 u
2 S9 v1 d& A2 Z; g( Y+ A0 b
array( "name" => "YouTube Video Settings",
2 V; F! F2 \6 [, L( j "type" => "heading",& B! ?2 n. P H# h* ^$ q* L( V% t
),# t" E& w' i! _% Q; A" `; |
& x. t9 P! Y/ b+ C0 p
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 o& Z* R- {: ?+ l
"id" => $shortname."_emvideo_activate",7 C9 a% @3 t' L7 r
"type" => "select",; T& x3 z! w! S* p0 V1 _0 N( F
"std" => "No",& v6 n: i3 \2 c2 z$ [
"options" => array("No", "Yes")),' T: s) S( X3 \) H7 c8 `; {0 T7 t
, c; M2 ~- i+ p# R- ? array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
/ ~) R( h! g1 t' b3 i$ d1 a "id" => $shortname."_emvideo",
8 E: f5 {3 \. K& i! [ "std" => "",
% g' M5 C# L/ l "type" => "text"),* Z2 Q4 }1 v( F- ^& @) {. `& \; P& V( x
3 e6 m/ h0 B; R
array( "name" => "</div></div>",. A# h1 f6 j7 K3 F
"type" => "close",
. S4 z8 f/ K% { ),
8 r& h1 g5 C: e& p8 t / w" g1 I* A; q& J! O# H( B
array( "name" => "Twitter Settings",
# [7 G, V& G: z L5 [+ @0 p& i! Q "type" => "heading", ?# P- Y& W `: A, y4 h& w) c8 O2 T
),) ~% R* S3 h1 X* H4 t; [1 f. ?5 C: n
4 Z# Q5 K9 x4 z
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% q5 F9 X; V& Q H- C "id" => $shortname."_twitter_activate",
" N' p1 d Z- ~, G1 u "type" => "select",
3 Q8 I- L& ?" |( @ "std" => "No",- ?# D: q& p" A3 j$ }1 q
"options" => array("No", "Yes")),
3 W2 s8 x3 ^6 a: g) o8 D. W' D1 O# a, C
array( "name" => "Insert Your Twitter ID here5 ^) f; y7 z3 y: |8 l0 V! @
<br /><em>*leave blank if not necessary</em>
7 z, I9 Q- ?5 l <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
) e9 [1 {, s2 C "id" => $shortname."_twitter",
0 i7 c2 \' `9 b4 T: P& `$ d8 I "type" => "text",' ~6 u+ b# Q' q2 w4 Y1 A7 w
"box" => "social",/ o1 U# b7 Y8 L& I6 D6 a9 q: w6 ]
"std" => "",4 q G: C% _% E* V ?
),# [2 ~4 Q) S& w& y J5 o x
, @& V- k; [1 g0 R5 D
array( "name" => "Enter Twitter Feed Count here v7 Z- _ b$ }; U4 U5 g+ u. G
<br /><em>*leave blank if not necessary</em>
+ `4 R* H2 s! p5 j4 L: F" } <br /><em>*Enter How Many Twitter Feed To Display</em>",
( F6 J6 n) s) w7 _9 d' H ^8 A: H "id" => $shortname."_twitter_count",9 G# a+ `, l5 q( W; a' V
"type" => "text",
! y4 x1 h% ?3 P o! J, C) h* \$ r3 `# N "box" => "social",
2 B9 q5 {3 R W5 R# k4 | "std" => "",
* T3 u$ T6 R9 c8 s ),$ l) a/ j0 t! R6 K0 r6 u0 m5 K
- \4 W7 u6 d3 M" X* Y$ F% h array( "name" => "</div></div>",. A& V; T% s* F( i8 u* i) @
"type" => "close",! `4 K# g% y7 X% ?' m0 L
),# [# K8 J/ L4 p+ R7 t
( G# J( Y8 m! j( E- `' L) K6 a
, ?* l. N# a+ N2 J
array( "name" => "125 x 125 Banners Advertisement Settings",' `; d e( v8 K- l m& i
"type" => "heading",; _( K) b: h# V3 {# Z# z
),; i) X* s/ M" f% T |
3 m( N6 A& u1 S$ R# C! m2 O array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' l! }; \9 W7 h$ t9 X "id" => $shortname."_sponsor_activate",
) t6 [& A+ R1 X8 `3 ^- R- y "type" => "select",, s) d# t/ G. e R' ~
"std" => "No",; Y W7 L- h2 L$ C
"options" => array("No", "Yes")),
p6 A2 f) l( M4 H : @ I. N; d, ]8 H# O3 J/ K3 w
- [7 S4 I/ t$ V! ^% q0 A- ` array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",0 W( \0 F7 S( X' c" Z u- T3 T4 h
"id" => $shortname."_sponsor_banner_one",
0 J0 Q. w6 _2 c& S: r6 Z "type" => "textarea",! v8 D1 L B7 M+ w5 l; j
"std" => "",
* j d! L3 [1 k2 J+ o ), 4 A/ h4 b5 ~$ y0 V& K
$ r! y$ ]. |% C3 V# H1 p1 U array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
% m' x# V; Y* N! e "id" => $shortname."_sponsor_banner_two",9 H1 z1 k+ R6 F1 ?, B( ?/ }
"type" => "textarea",
! d/ i' n6 r/ o3 A& z$ m "std" => "",
" u+ ^2 t5 h$ p# A ),
" i3 }8 @2 H7 ?2 d6 J* o' K" {. S4 q2 U. r% z' [
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",, B9 J: j* c! D
"id" => $shortname."_sponsor_banner_three",; A0 F# i* A: t7 N' V
"type" => "textarea",
- }$ n0 g6 ^5 m7 W "std" => "",0 ]' k" e( L- V, W
),1 I0 g$ W7 |$ u) x, L& e) \
; g- @: D8 ~) K1 d" v
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",# s& C) C' x& H4 O# T( ]
"id" => $shortname."_sponsor_banner_four",
$ K6 O# e8 c$ b7 t2 n4 Z& a! O! D# Z "type" => "textarea",) E5 o. T+ |+ h+ Q; I+ z
"std" => "",
& w7 n5 V4 A* ?" ]3 |9 z ),
3 \2 ^3 P2 j. ^. Q/ |" f7 I& E/ P6 | y+ v
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
. E" p$ G+ [7 h- n! V3 [ "id" => $shortname."_sponsor_banner_five",* ~: t# e4 L' E5 K0 y
"type" => "textarea",5 H8 M5 l% \* t* X1 _
"std" => "",3 N3 H9 J/ U4 s% G
),; N V: w5 X" _! x0 s& Q
- V6 M3 ^$ {$ I+ K
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
! B" W2 b4 O5 o; i% w "id" => $shortname."_sponsor_banner_six",1 B" J/ A5 \! \
"type" => "textarea",: R7 h* ~% z( A; [% e
"std" => "",
3 Y0 f" p' ]6 Z; h j; y ),
& {' i6 H+ w; Z, c; L! y/ O3 O! f* j+ `( c, ?; t, s1 M% M0 |
array( "name" => "</div></div>",
8 Y$ Y% l" e: h! P- @+ `3 ^ "type" => "close",* C' q6 }' U* h7 G( N
),$ c( @9 E0 S1 V. r; N
) Z) A w# f7 L, T
; S E0 c3 u9 k0 m, s" g
1 l3 W% g; q* ]( }0 E6 z
);
9 M: s. g6 t$ t% E! G1 i
$ P) N# M- n8 ^' G# h$ tfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {4 {6 U) s3 }( z5 \3 a( ?6 ^
1 v$ N& X" q+ U! o, V
echo "<div id=\"admin-options\"> ";3 T6 E5 ~' \6 F8 E: A
& z) v& ?) e3 U8 M. g. T6 J
global $themename, $shortname, $options;
! R/ {8 ~' R. S& W6 P: Wif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';) J( ^) X) G; J, {4 a" s* P B/ t; m
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';" Y( ~/ ^+ Y' ?! H' K
?>
+ Q& K9 f P1 L- `7 B% E: P; L
9 i1 I' R. q. N% O, [. j<h4><?php echo "$themename"; ?> Theme Options</h4>
9 J4 t) ` l7 U2 U: K7 h1 V7 K1 y/ \- k! U* L) }2 a+ A9 P
<div class="annouce">
( m# o) G# r( R; b( c9 `" X" R<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
* H# @, @8 r3 b1 t( n4 H: }( U" Y<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>; Q# N8 [6 r, d
</div>
: S8 B- g' T% Q) v5 w9 j, c3 ~2 Z, n5 O
<form action="" method="post">
+ _) {3 g1 S0 c5 _) _: I. T% A2 A1 _3 x8 V2 U# A0 l; f3 f
<?php foreach ($options as $value) { ?>
3 E) \: q; M* y/ l! z) w
; `9 h6 ~7 m+ w<?php switch ( $value['type'] ) { case 'heading': ?>
8 @5 j+ C9 M: k& j: ~) P5 `% J2 `8 P6 C. e2 i+ F4 S
<div class="get-option">2 V/ M; l1 Z$ x# K3 o) e* Y7 Y
% I; z& q0 k5 e
<h2><?php echo $value['name']; ?></h2>0 S* M4 J' t! L+ @. p0 @7 h- A2 n
& f8 D( ]) f* j/ s1 J2 Q
<div class="option-save">2 h- E3 a7 Z0 k+ K: I
' Y, B) w9 {7 B0 }$ q: B2 p
<?php
& o4 ?) l7 _7 U: m2 V1 x4 bbreak; R/ |' C( [6 O4 |8 V) @5 s
case 'text':
0 l3 `+ |, E7 _% [4 F4 ] Y?>! G/ Y$ q: W3 Y8 n2 V
E% T2 o: x- b
<div class="description"><?php echo $value['name']; ?></div>
1 |3 z; k: ?9 |<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
( U9 V. O; O* R8 L; t
% J5 V, m1 K! S' ^& l; \/ Rget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
, B7 Y) X" o4 e+ ^/ g! p" L1 c7 D; @& X$ Z5 I" R
<?php( V0 v J# p0 l. k: i- V; P
break;& A2 p0 v( l9 W+ a- K4 H
case 'select':
& W7 p+ _. S1 J/ j?>5 v g* k: ]9 A; L
) s* {* {5 U) M9 t' P: G/ u/ P
<div class="description"><?php echo $value['name']; ?></div>/ Z$ W, R! [8 K u* i* Y
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
8 g% G$ H* {+ c) E% k<?php foreach ($value['options'] as $option) { ?>1 M+ j, o- f8 j4 R7 n
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>2 T n# _/ A2 A6 T3 k
<?php } ?>8 |6 n" _, T1 r/ N
</select>& p* H5 r4 \8 q) c
</p>
3 N. P, k: N- B% n" V ~$ v9 e3 L w6 z; \) i: C, X1 Z
<?php# Q7 s4 O! B, G- K2 ?& B* G: r3 e4 i7 ]
break;
; M: W' G8 d: P7 ^case 'textarea':
* h7 V) V) M: g1 f$valuex = $value['id'];
6 C' W2 H; q/ Z$valuey = stripslashes($valuex);
4 O" m6 z4 Y2 e5 C: w$video_code = get_settings($valuey);$ h* S7 `2 W+ p
?>
* z V1 u# h! p) N( N c5 f
2 a T; O5 z+ n1 J6 t<div class="description"><?php echo $value['name']; ?></div>
0 \& l; G4 D# F5 C0 J) H<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
* Y; `( s0 _# x! M8 K! d6 Z! g+ r( R- f% ?' y+ A7 V, E
else { echo $value['std']; } ?></textarea></p>& a! d4 F3 A4 D' I
9 S' ]; l: o2 j
<?php4 T' |' b- \+ a0 S
break;
7 x7 M8 q( q$ {$ |1 ucase 'close':8 h9 G5 H; u1 N- S
?>& l4 G4 N. \( f6 r
3 x: W, y5 |$ i3 }* H3 {<div class="clearfix"></div>
8 B+ U+ G0 M+ c& F" i5 f! k</div><!-- OPTION SAVE END -->
4 K5 ]! L0 k- [% }$ m* o% J. a u- `+ ~" U
<div class="clearfix"></div>: t& e/ e+ E$ ?" j' w0 I! ?6 o
</div><!-- GET OPTION END -->/ B) Y9 j7 b% s y3 J4 a
' ~( V5 I2 |# y( E
<?php; T4 ~/ l$ \/ }
break;
, I4 X) w/ ^3 S T/ L$ n/ I1 ^0 ddefault;7 j; g5 U3 M+ K4 g; }) w* ~/ Y
?>
; r& m- A; H- ~- b8 o8 b6 m" |. @& o% v
' m( m9 ]+ t, X0 R+ I
<?php
4 M8 b: I; B2 ?) Cbreak; } ?>
' c) Z e ]. e |. S
" ?! R( S5 v0 p/ ^7 t<?php } ?>
+ b+ L% K1 n5 Y
$ G* z% p( v3 ?; S<p class="save-p">
; r3 h0 q/ ?" [) m) M<input name="save" type="submit" class="sbutton" value="Save Options" />
2 X9 U i" x6 S0 o- r) O/ a% n<input type="hidden" name="action" value="save" />
\8 m k d$ ^</p>
4 v6 q1 ?% K5 O `) B. j( q+ ]</form>
6 f2 O5 k9 t0 Y" G) \ [& p' _6 e/ s) R+ }
<form method="post">5 L6 _! T% v' ?
<p class="save-p">% I, F+ E% x1 B5 ~! o
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
; X& g1 a6 h( @% P& J W<input type="hidden" name="action" value="reset" />
8 c7 I& m+ f' b' x: ^0 x</p>
# g4 z2 @9 u; ^" T4 i {1 h</form>
$ A3 b1 c; C6 d/ ^4 F5 D& {/ ] u, G- l9 N
</div><!-- ADMIN OPTIONS END -->/ u8 p- t8 a: n- o0 ^
/ j$ a+ g5 Q- b- I% x7 T4 s<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }: b! _) ^+ W0 E# u) ]5 e
) h3 f3 Q8 c: Tfunction mytheme_admin_register() {
7 H& L @1 Y' k! Sglobal $themename, $shortname, $options;
/ n5 z R/ w. m# z9 Y$ B$ gif ( $_GET['page'] == basename(__FILE__) ) {- ~ F( E! H$ g, G& a8 u/ N( V
if ( 'save' == $_REQUEST['action'] ) {% }7 Q* g- s) m/ {8 Y" L9 I& t
foreach ($options as $value) {
$ ~7 R) t, y3 |2 e* U+ ^! b( g$ Aupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
) s0 A9 ?! K5 J# ?. Lforeach ($options as $value) {% z9 \) R: e. O% v# B/ z. X
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }, C" P0 v) d: w* L6 x0 F2 e
header("Location: themes.php?page=functions.php&saved=true");7 P2 q4 u" x% ? F4 n* N- Q( f! W
die;
) N8 y: }. l" r% ^* k g} else if( 'reset' == $_REQUEST['action'] ) {
& Z& H! v$ x# c4 ]3 }1 Jforeach ($options as $value) {
. N* ]4 P9 @2 p4 udelete_option( $value['id'] ); }
6 i0 u6 L6 n- z* c1 Aheader("Location: themes.php?page=functions.php&reset=true");
7 w% P/ E. q, `2 P* ~5 Z3 {1 V4 M9 ^die;) v; Y% Y" Y; S$ \" q+ O% f. L
}
d; Q$ P( M5 n2 u6 Z5 S8 a, u" j}
% Z0 h" I8 C2 E3 u% g1 g7 ~add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');4 T0 X& W" Y3 e; x6 @2 W$ f+ a
}
* K$ T5 d5 H, z& g8 E/ r& k* i$ P- y [; c: D' k3 U l2 `
function mytheme_admin_head() { ?>8 E9 |! X: P1 O% u |( A! m2 C
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />7 K/ I8 N5 t. A' P
<?php }. m0 n- A% c' Y: I# ~/ z* |7 r0 U
|
|