|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
0 T U- k1 g |9 l! s- W// Theme Option
' n0 O3 Z4 S2 ?9 r////////////////////////////////////////////////////////////////////////////////+ g; A6 F1 Q* ?
v: l3 |/ d$ L( C* y8 l5 `$themename = "Zenx";- q7 B u" v/ D' n/ p' G X; L; k
$shortname = str_replace(' ', '_', strtolower($themename));
% b) Y! d# |5 t) ?; V4 b: D7 b
3 k. S' m& D* E) i, G# I7 D6 [function get_theme_option($option): f% t. G- R# v8 x* b+ U y3 o( d
{6 b- w9 b( \) N% e/ p: z E
global $shortname;$ Y* \8 o& s% E
return stripslashes(get_option($shortname . '_' . $option));' f1 b2 t( t: O. u6 l; a
}5 M1 T' Z$ [, E1 a$ p( }! R
, ?2 Z( x% {# R: A A/ l" `
function get_theme_settings($option)+ a& a) F% j7 g, V/ r7 {
{+ j: ^! }- u; Q& f, w( O& e
return stripslashes(get_option($option));/ d+ y0 J5 u% e
}
$ ]0 \8 q+ A& T; E9 t5 m( H$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");
* g1 |" Z& x* R# o+ W$ J$wp_getcat = array();
$ M9 e& ]% }* ]1 Q, ?6 Cforeach ($wp_dropdown_rd_admin as $category_list) {
: D& m" \4 `$ H* [% I; H$wp_getcat[$category_list->term_id] = $category_list->name;
4 B. Z b6 R- j* J; k/ t+ ^9 n}
+ ^: E/ l( h8 [- ~1 L. O7 N$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
4 `% o* L7 W" j4 u$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
C4 ?6 p$ o* J$ `6 l6 V$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");; n8 n; _" t& a3 {8 b, \
; D9 E; V& P1 Y$options = array (
$ x! Q) F# g5 Y% i
* v1 h; R, B7 u" u+ Q& N
- P# d* w; b4 {) ~ array( "name" => "Blog Header Settings",
# J5 b+ _9 E" e& @, s& ^ "type" => "heading",1 b: Q9 o2 K$ Q
),
H/ }* n$ N7 S U6 X6 S$ Z7 L5 `! X' @* ]" |) O2 |: r' d0 n( L
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 T6 k* ?0 k$ Y3 G! h "id" => $shortname."_header_logo_activate",6 C; P% f$ n3 L5 @8 f
"type" => "select",
2 j3 d5 m5 ^1 ]! P$ s( H "std" => "No",+ }! |1 B/ t. O; r5 B/ g- Q5 R
"options" => array("No", "Yes")),: e& W( d, U" R S/ \4 E6 S6 l
' u) Y5 }6 y# N+ h& t, w4 O
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
7 L- T7 o3 T9 @& H4 p5 g5 `& s6 \3 p "id" => $shortname."_logo_url",
- |) C/ w& Y2 z m: ?* Q "type" => "text"," {, ` j* @' O
"box" => "social",( x) x5 V% I- |& z" `1 S! {* ]9 o
"std" => "",
6 B% B. C$ g' ]8 t. q1 S2 { \ ),
% X; l6 g% n- i% j) U+ D! I 6 T- a$ U+ Q, ?3 w
array( "name" => "Insert Header Banner HTML Code (Header)8 _8 o5 {( u! A& n
<br /><em>*Recommended Size 468 x 60</em>9 _8 B9 P/ M1 v; O; O4 O# b/ E7 i7 p. o
<br /><em>*leave blank if not use</em>",. T' _& V' t1 Y1 [( G
"id" => $shortname."_header_banner",; E0 j$ k8 }& U& F. t* T
"type" => "textarea",4 G; K0 I9 a. f8 ?
"std" => "",
2 J( V4 E |2 P$ T! J7 G# P0 { ),# j/ K8 Y* _1 S$ v* K7 r2 N
% q+ [$ @1 b* S9 ~1 w2 { u array( "name" => "</div></div>",
* T9 t% M1 A7 R5 I; d u "type" => "close",( Z! T5 o4 ?; K2 f0 A
),
3 z+ Y: j6 q5 u4 V
, X' x% g& z3 f& B& V" _8 r1 g: f- Y& h4 P5 g
array( "name" => "Header Navigation Settings",# X; M5 ^8 B. B8 Q4 H" [( U- T. D
"type" => "heading",( x$ F0 F. c% c* g# ~& D4 d# O; W$ [
),
4 m- y$ C/ [7 m9 X% @9 `- N& |! K
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
; @. W6 O# m# }6 }% @ <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
. x0 l5 u. Q& ` E8 i9 r <em>*Enter the page post ID number only</em><br />1 L; B3 R9 g& J7 r1 m
<em>*separate by comma</em><br />
& g3 F$ g# f6 e; P; X# k <em>*Exclude pages which you don't want to show on the header navigation</em>",5 ?, ?! R& K+ w1 Y6 s
"id" => $shortname."_header_page_navigation",: S* M( |/ G9 j. j: z; s- G
"type" => "text", q. A, W. J5 O1 ~) r
"std" => "",# \ Y' H1 c! T1 Q, M9 R7 w
),
4 g4 W# |3 h. b, }) _6 k
+ U0 v1 w9 G9 ~4 s array( "name" => "</div></div>",
# `1 y0 L" k3 F) R% P. r( H/ P: l "type" => "close",# ]1 g4 V' e; K: g8 _! ^
),# \# K& l( v8 _# h
+ B8 I7 {3 e! L# H
. m$ b$ J' P1 X. q, |7 O: L: _
array( "name" => "Post Auto Thumbnails Settings",/ }8 L7 w( n' D: K- J* ]% `
"type" => "heading",$ L6 ^5 R- ?7 p2 W0 S, ~; c
),
% Q9 C" ~/ p5 m+ z& {5 d) C1 S7 k ) G8 X# L, I! d3 h/ D
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 Q3 w" V, {' ^: L "id" => $shortname."_timthumb_activate",
1 w/ O+ ^" M! a n "type" => "select",% f ~) n4 Y! n) \ z/ ^! M
"std" => "No",1 P& h3 \& Q" t7 N
"options" => array("No", "Yes")),
$ E" R' M$ @( X & ~( W& N& Y% q3 @% h7 ]
array( "name" => "If Timthumb is enabled, Please choose its cropping method",' B Q }0 Y3 ?& h! [, H2 K
"id" => $shortname."_timthumb_cropping",3 h2 }- {5 e! F
"type" => "select", s' Z5 k; S. h! J" g- y. {# h
"std" => "",! D G. `+ J n2 s) h
"options" => $crop_position),
0 U; i9 y$ F; s F( b; F( l, U% S! K7 k6 `: u
array( "name" => "Insert Width Of Thumbnail Image<br />3 _5 y# ^( _6 b( n7 C
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />2 r% u4 v0 `0 Y- D0 y4 ?; O" w
<em>*Leave Blank To Use Default: 250</em><br />",8 E0 f" H% E$ o8 ~5 L
"id" => $shortname."_thumb_width",5 L2 L, h' ]) m- `
"type" => "text",' H$ f! I# A7 s( f, n% X
"std" => "",
5 k; d+ ?* Y" @/ U5 q ),
' `$ S1 ~ R) V4 @4 N) e: h. o q! t; o: b& z0 O: Z
array( "name" => "Insert Height Of Thumbnail Image<br />/ B6 K3 j: Z, X- v6 D C! S
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />* `& G4 X# J8 {2 e* _- U2 k+ r
<em>*Leave Blank To Use Default: 200</em><br />",. Z9 O+ ]! S# |; u, J9 ]2 A8 g
"id" => $shortname."_thumb_height",( T3 f& _2 ?9 a
"type" => "text",
, P/ t! C6 ?: M9 Q* E6 k "std" => "",9 H }" y/ z# d( _% Q3 V, c
),
8 c2 o' t2 ?: m" z% u7 l# B' u. ~- D( q
array( "name" => "</div></div>",
& O: C% Q7 W! [ "type" => "close",
' J. D! H7 e$ d( N ),+ O, }8 F2 k/ j6 s) U+ v9 A
& I N, f( C% N% N- E I' ~& b0 j! | array( "name" => "Featured Content Slider Settings",
* a. T' T9 y- s3 h$ I- p/ r "type" => "heading",, l9 q. f+ q+ H' [2 ]: g9 @
),
* m0 x f1 K+ G; _8 g" u v. [
$ j* L, }: s% E& l array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! p! ]( A+ s' ^# @+ f; h) E
"id" => $shortname."_featured_activate",
# v( h& L; i0 n6 W( Z; L f "type" => "select",+ F0 J% c6 a1 q3 G6 F
"std" => "No"," D0 ?# X K% H j5 k
"options" => array("No", "Yes")),
7 @0 e- t0 ]# G& M% W( R; }% Y, W8 F) Z' i8 F% v
* `: Q2 B. q/ w array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
1 c0 \2 U6 M: i6 G& u: m3 f- A "id" => $shortname."_featured_category",- V6 s" X# m& U
"type" => "select",' D; }& Q1 z/ H4 Z- g. ^" k z( _6 ]
"std" => "Choose a category:",
) O$ v& F- Y, H6 o# T& @; n "options" => $wp_getcat),# h1 U2 a/ {+ y2 d' X
9 L3 ]$ s( Y8 |
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
/ R3 e0 Z/ E9 f% e0 Q "id" => $shortname."_featured_number",& ]# Z4 H& g$ c q$ y8 F) s. E
"type" => "select",
7 L, b/ Y0 S3 c" M$ v7 P "std" => "Number of post:",
7 r& |! U W2 x4 @6 {% B& | "options" => $number_entries), N" D+ v3 t+ s% e/ v( u, P
- Y7 ?' S# y8 i' S/ n. B* K! _ array( "name" => "</div></div>",
/ S# D; M& D" O* J" H& }# T0 Y s "type" => "close",
m8 O. S: _1 t' K ),1 Y( y; ?7 A- F$ @8 C
) O; U7 G! S2 Y" p; _7 a6 @ array( "name" => "Featured Category Settings",' j) {3 T* F# V
"type" => "heading",
" Q/ d" d1 I) C' F2 \) f3 Z ),+ J5 I8 d! {0 L9 @% Z, s2 d
! U6 X* w; V3 [9 n8 l+ g3 Q array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; X5 N C& N" Z4 K8 \2 N I
"id" => $shortname."_featured_category_activate",
) `2 o! H- e/ x* g: A "type" => "select",$ }; ? `4 p; V; d0 W. ?/ O' C
"std" => "No",4 T. M* G# H$ O5 a2 R% l% e
"options" => array("No", "Yes")),* h+ |2 [, d% x$ h4 u( o& Q$ f8 \* N) O
: ?# \& b+ i6 D6 U8 z3 v! j
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
# E" R# A- ?$ `! O6 x "id" => $shortname."_featured_category_id1",
) t& d- |& e( S i2 A1 \8 E "type" => "select",/ v1 [' ^6 B: q# v9 O
"std" => "Choose a category:",/ u: H2 u8 @0 S
"options" => $wp_getcat),
9 I4 S! K( \4 u6 l2 v- r
- Z8 E1 E) T k) g& H array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
8 V2 d1 b: r$ l! m "id" => $shortname."_featured_number1",2 {/ B* t; P2 M4 l
"type" => "select",4 e3 {4 G. d# O0 R) M) X! e
"std" => "Number of post:",
% a: S: E# K# |" K0 F "options" => $number_entries),9 G) B3 h' o! Q% Z* j
9 J- V$ D* a6 A8 Q M: b array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
: u8 X, e! z$ ]' [3 I; i% E7 { "id" => $shortname."_featured_category_id2",
& H: y& m$ {0 e, N "type" => "select",
: j" f' A6 m8 w J' | "std" => "Choose a category:",
+ Q+ T o/ Y, k2 ]- a: i [ "options" => $wp_getcat),
7 W* f* J3 t) X! ]* O3 x3 f / Z) X9 G3 j& x
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
% b5 l* X X! f8 N1 F8 f3 I "id" => $shortname."_featured_number2",
; T/ R# q( J7 ?0 J% d( `6 F "type" => "select",( Y6 F! n7 _* |& \/ X! P
"std" => "Number of post:",4 y4 k, \6 O1 J" i2 Y
"options" => $number_entries),: R( e' B# ?7 D" J
a3 m7 }+ U5 k6 {& v H0 @) [
& G: |& Z" c$ F: w( K9 a
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>"," Z7 g. r4 x8 J8 h! Q
"id" => $shortname."_featured_category_id3",
+ ]( u: t- v& Y7 p "type" => "select",7 B0 a0 }1 Y( D; V8 P. H0 \
"std" => "Choose a category:",
0 p6 _! u1 b' @ "options" => $wp_getcat),
- s1 w2 s' [2 S+ h5 z
5 z" _$ D7 X7 Q; ~- [6 h6 U array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
& P0 O) W7 K! p* x "id" => $shortname."_featured_number3",
* f& R# ]1 Q3 s" }% m1 c J- Q "type" => "select",8 {+ ^. [" I! t( X- {9 J; S! C) _
"std" => "Number of post:",
9 C/ v! V0 ]! V" z) b "options" => $number_entries),
' B. r1 f) \3 S! d
+ @+ {% ?- U( w7 B, E: d3 p+ B# Q/ R: `! X8 D) O
array( "name" => "</div></div>",
+ ?+ o% \ ^3 z( s2 k "type" => "close",: K2 M, L# e% R7 [) L
),
5 y6 ]$ W/ \) d) j0 O, R, Y8 |! q% H$ B9 c! |' k" Z+ \0 K
0 y% c- x! |- Z) y5 `0 ]
array( "name" => "Google Adsense & Analytics Settings",
' |* i( z# @/ O "type" => "heading",7 _- g! N) g; u! K! e/ \8 l
),- q5 g3 |6 I! I
' ]1 S0 |+ i% J8 r0 ]( p
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
2 j' B e* z9 M: G; h "id" => $shortname."_adsense_loop_activate",
, p0 C' U+ H. T8 G "type" => "select",. B4 ^: [7 L) v$ S8 m' D( s0 Z1 t5 q
"std" => "Disable",
4 g: Z9 P0 d9 {) t: a* A "options" => array("Disable", "Enable")),% ?2 f% U& n$ C7 a. I' Z
1 D+ m K2 ]9 X* K; B9 p/ S5 J
array( "name" => "Insert Google Adsense Code For Loops Here<br />' o3 L O1 w( Q! A
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
1 T4 z ^ D7 G# H9 I4 b' u "id" => $shortname."_adsense_loop",# ?5 d. n e6 D S
"type" => "textarea",
5 O, V( z( M% U# p$ A, n- e "std" => "",
: T Z) V" b/ M. _- l' h )," L$ B3 K7 k3 t) Z& M/ w3 Q
: k; L+ B8 q. D$ N
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>"," G) M, G8 P; l5 q
"id" => $shortname."_adsense_single_activate",
' D/ Y( `1 ?( J8 { "type" => "select",& c- k( u( t" f" a
"std" => "Disable",+ x) K% A3 K4 \
"options" => array("Disable", "Enable")),
3 D. x* a( z. x* W6 l5 L9 S- u; d0 j1 i$ F: r
array( "name" => "Insert Google Adsense Code For Single Page Here<br />1 B0 }7 s: e- l4 s9 w* |6 ]
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>"," }) Z/ V6 M! v% B' N. ]% P
"id" => $shortname."_adsense_single",
: p. K- L- Y: b. p9 r* D n; Y# J "type" => "textarea",8 ^+ J/ L: u. q- _, _
"std" => "",
, ~) E5 y; ^) P6 n& v+ }2 H, H ),
" I. ~+ j* [$ J' W6 v, Q4 u
# s. N2 b+ K, S( Z/ _3 M6 Q
) ?* J. `7 U: H. M array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",- S- S' ]8 W3 u- z8 h9 B
"id" => $shortname."_google_analytics",
/ P0 c+ t5 T y4 u; i7 b "type" => "textarea",% Z% S& Y- G! N, e) |
"std" => "",
, j% H; S( G0 K5 t* ? ),& E; o( z, l5 e& g" b) o3 D
' V! c+ e) e, Y4 ^- o! B& ?: h array( "name" => "</div></div>",
+ K u# l s7 v. g, F) H \ "type" => "close",
$ `. W4 u0 B: w/ Z* \- v )," s4 w* o7 _% m8 b, M) g* {
3 [3 a/ u& g% P+ G/ p; u4 w
! U) d" g/ P+ |8 ~ array( "name" => "AddThis Social Bookmarking Settings",, c3 f3 {; {2 Q
"type" => "heading",7 p$ G- r$ g& G1 Z0 U( |1 W* P7 X
),4 \9 U7 V8 F5 c1 J3 M# i
. F& K6 B+ |2 U% ?2 J
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
7 d8 T; K! {9 p2 I9 Y9 n9 h <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",7 n& D% u6 |4 q: F7 w
"id" => $shortname."_addthis",
2 I# }1 P$ ^5 _( Z* [7 d "type" => "text",
. k% B7 Q: j: i/ z9 C% J "box" => "social",
4 ^9 a' d8 Y% `/ }# Z& \ "std" => "",
' Z& e: E: W t, O ),8 e4 r; |, q; e Y& H+ u7 B6 l& W
: _3 c) L' f/ o- }0 J2 T( u
array( "name" => "</div></div>", L8 i7 f5 p$ I* w
"type" => "close",% ^5 n$ P8 g1 G5 Y
),0 ^" W+ t6 d* S# `0 g4 J; e* P
; @; Q0 u* Q. n/ c7 b2 {
0 x8 v R+ h5 U % E* _, h8 B, e% H1 R2 ]
array( "name" => "YouTube Video Settings",9 p5 ~7 o6 a9 [
"type" => "heading",4 \+ n. S8 X0 d8 i; c3 n$ A
),
! Z& I9 N5 `7 x% r
% H& `% G3 u# J$ ` array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 |" h$ A7 h( I& K+ L "id" => $shortname."_emvideo_activate",# m- C' h7 i4 {) j
"type" => "select",
9 f" I4 M$ s7 Z3 V7 R B "std" => "No",0 i: K# ~, n' ?3 H9 u% X/ A8 P
"options" => array("No", "Yes")),
X# y, v# |* }$ @5 a
1 Y0 Q. \( u" ` 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>",
( N, `0 i: D( ~ "id" => $shortname."_emvideo",/ g, `$ G6 r# M9 u
"std" => "",7 r/ v. U% b- Z! ] |
"type" => "text"),
) W! c, Y% F& V2 e5 K9 B
4 O- j* x0 `2 X p+ R5 M array( "name" => "</div></div>",
2 {. S: @9 s: m7 @ "type" => "close",( |! |# p( z) H: |, V$ V; `, x5 \
),, c/ I0 }. s% C( ?7 G
& W! u& s: s- d" {+ f% F
array( "name" => "Twitter Settings",, N: G& \2 `9 v7 O8 Z$ n2 W
"type" => "heading",
# n) F% k/ L' ~# j6 X: {3 t7 k; E ),
. n- p1 l+ W& O; I* r9 x' S5 S1 f. T1 H1 e$ ?0 |
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 c4 T: h9 ^. o) d; X% }6 e4 b- e+ ~
"id" => $shortname."_twitter_activate",
9 X$ u7 r% h6 r" D; l "type" => "select",& k9 Y* N( A. e+ P" w
"std" => "No",
4 [7 \: P' T% X4 j "options" => array("No", "Yes")),
7 n3 Q) ?# p* p! b5 w* _2 x$ |. r) `8 A) `2 g; T$ {( V
array( "name" => "Insert Your Twitter ID here6 n4 u7 ^+ J) Y8 W: m
<br /><em>*leave blank if not necessary</em>3 s: V' k- @6 z, c" d) n+ g: J
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
, L4 w: a. H! T( m0 x "id" => $shortname."_twitter",
) \! k# ]9 y; b6 A3 u7 e "type" => "text",- ^& t2 b, b8 W/ j* e K2 y
"box" => "social",
. J0 i7 G. m( k3 `+ d "std" => "",
: ^. W! S) D7 _# E ),- G" n) w! e$ X3 `& ^
) }4 i; ~+ k2 w, b- f) a( y array( "name" => "Enter Twitter Feed Count here
* |+ i W( L& z <br /><em>*leave blank if not necessary</em>
: U: k+ P# r, r* @ q/ [ <br /><em>*Enter How Many Twitter Feed To Display</em>",' P: h! z3 P4 [) x
"id" => $shortname."_twitter_count",( [# t2 g1 {6 |5 [6 b
"type" => "text",
' X8 P% w% j; i. l( a5 h "box" => "social",/ Z6 s2 C, k7 o; Z$ D0 W
"std" => "",3 N* Z9 P7 v( `! h1 Q, w( N
),
( t, J4 b4 D3 Y% _. ]. ?$ v
' V& |5 M- P0 k4 }4 q1 v+ V6 h array( "name" => "</div></div>",
" B$ K0 s$ y( M% D0 G; t "type" => "close", V: \5 n R$ D( {# p
),1 Q' u7 {: h" D2 ^' ~- ?9 q
# b0 E/ W2 M- l1 Z. z
$ R0 p* D- }! v) l8 L6 I3 |! p. m
array( "name" => "125 x 125 Banners Advertisement Settings",
2 [; U% U) B8 @+ D0 d "type" => "heading",: m8 k* A, w7 ?' ~0 L& G1 u
),
5 C. @( `& t( ^' ?. Z) Q " w% R: D G! n
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 \. S1 z! W% i* D2 O; u% L- j
"id" => $shortname."_sponsor_activate"," t" _. ^+ }( Z R+ Z; t6 D8 U6 o
"type" => "select",
8 a4 _- T, f( J "std" => "No",
0 B( N0 _) |- A* m% }/ z "options" => array("No", "Yes")),& Y! Q- X! y+ l- a% }& m
) x6 z; {' [2 X/ A* @
E& I. x6 A/ b6 [6 A5 r- P
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
9 c. k2 X! J$ B* i4 } "id" => $shortname."_sponsor_banner_one",/ z: s4 u2 j. q& Z& R7 q5 n
"type" => "textarea",
& w9 w! q0 l( ?6 f7 d+ l2 w& s "std" => "",# H5 m' z5 S6 N4 G5 u( f
), 1 d2 {/ a- Y# |* H7 L% C$ B
$ G. e& [) v, O9 I* m: O H array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",1 a2 W1 a3 i& L, ?$ |9 n8 _
"id" => $shortname."_sponsor_banner_two",
s* ^# `7 W) z3 m- ]) | "type" => "textarea",
7 K% a* A9 A( L8 @ "std" => "",, b: s% S# n$ k* V# f2 @' B9 a d' m$ ?
),+ z8 E, r8 @5 t1 a6 x* }6 k; ~0 z
# T2 c f3 P! M% Y8 L6 H# h, R$ P6 {2 b array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",5 X6 O- `) ^8 e
"id" => $shortname."_sponsor_banner_three", ]: ~+ r1 @0 r3 I& E
"type" => "textarea",+ _" o/ m3 |/ u1 E, [: } b2 h
"std" => "",
/ O) v L3 x% c$ W. x ),/ ]8 ~2 s( @6 l* w) d
4 T' o3 f2 v! U# q
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
9 w! u+ Z2 G# ~' h! P "id" => $shortname."_sponsor_banner_four",
Q8 O* d9 }$ E; z "type" => "textarea",; N+ @0 A2 K+ p- u* Z% ]
"std" => "",# s, v- I; l; \, X6 ]5 c# |
),
9 D* e3 g1 d% S2 l: F4 [! J0 T: M1 u- \5 g& ~8 ?
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
1 g& \& P0 i1 x6 f7 I "id" => $shortname."_sponsor_banner_five",
& K T: v! s- p; H! u% ]+ t+ n "type" => "textarea",
$ `0 X; W/ M& u q2 j "std" => "",
6 W \' _, h* |% `! j& M% S* c ),
! i: k# S% v# n& r; r
" |7 z3 a& \9 {/ f. \8 s- L array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
9 u; [# C1 p5 M. m# a% x% m f "id" => $shortname."_sponsor_banner_six",
0 c( T- \; Q" Z6 I' t$ ` "type" => "textarea",
3 \2 v; g0 b: _) |! @* W6 r% a "std" => "",, ^8 M* r+ A: e: ~+ D
),
$ S+ m8 I1 t4 i6 m; d. Y! _, s, T8 T6 F4 D x; K1 Z g9 ~
array( "name" => "</div></div>", L5 T9 M0 J- v9 x- T2 e8 M. k5 V
"type" => "close",
C+ I* N7 {6 C C6 [- M ),
$ {6 ], ?3 J6 ^& {+ O- E1 p' o" r7 s7 U6 B4 N4 p6 O
3 l7 x) a3 j. ]: d( Z
' X0 ?: w; N& K, \: w) q# j: k3 F);7 V7 I% z" c/ G9 h: P
0 x# q3 f5 X I$ N9 n$ K0 s0 a3 ]
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) { `3 }( d+ v' H
2 a& _; c8 q( Z& D- f; E, S4 A
echo "<div id=\"admin-options\"> ";
) g- X a9 e' x4 C! V7 Y/ J: a/ E3 p8 X+ \$ _8 D$ J! Z& @
global $themename, $shortname, $options;9 R; \" _ J/ ]- B
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
3 E2 a. ?' ]* G8 W" E/ J! _if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';, ]$ t$ U* M/ @, C' _+ |. f
?>
( Y; q' t/ v, \& R( p
. Q: }8 d& j( b. B: F9 R<h4><?php echo "$themename"; ?> Theme Options</h4>4 b- Y- r# l) j5 t- B7 g
( f1 K2 ~% |" r<div class="annouce">
( X: h8 F$ J1 Z- ~<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>* h$ A5 @+ [( Z6 t. S% Y, g( e, 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>
0 d# y* P" U ^; P</div>3 B& H" M( Y1 H, c
" V5 G3 i9 g5 B" a: J# W B<form action="" method="post">+ k* p& @$ W3 }0 e
" a& d s5 j1 f' N1 i3 Y% ~/ S
<?php foreach ($options as $value) { ?>9 n( P" @6 F' y5 v6 e
! Q0 M. m2 N% x; K
<?php switch ( $value['type'] ) { case 'heading': ?>+ s) Y# D% f. R# g# [! _
. v5 ~8 T, z8 D- C+ m& t<div class="get-option">
3 k: j! F" B+ q$ @, }
4 ~# c* X6 e$ }6 i/ l/ U<h2><?php echo $value['name']; ?></h2>: z- K5 a( A5 [4 g; z
2 x+ M% x/ h- v+ y<div class="option-save">7 [0 L, m( c3 b5 V
& v Q8 G& a( D$ W0 M/ b<?php' M' P) H9 b6 _% H% A1 X
break;
+ d, @# K' y& p' Lcase 'text':2 u3 z9 }0 v+ g
?>
6 W$ Z* ~# `3 X5 T8 V! c" T! w! F) d# ~8 X
<div class="description"><?php echo $value['name']; ?></div>5 ?4 X! e! Y. {1 X
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (% @ m' J% [; {& {1 I; C J$ u" H: V1 A
- l4 G$ O/ A" ^3 H! \" T! kget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>" w* D- @8 \* n( F, _' ]. V; L
4 T8 a; m" a6 O2 B& G
<?php( ]9 z+ v1 [8 ^
break;: k2 e# h0 `" r% J; N$ f' E
case 'select':3 e2 O. `, u- U" e* l
?>6 m" r1 g9 N% h, B( a
+ l! n3 y1 ?) y+ C5 |- n/ r<div class="description"><?php echo $value['name']; ?></div>- p( l2 L2 b, ?5 N
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">; H& @3 _1 w1 @# }
<?php foreach ($value['options'] as $option) { ?>
: s) B/ r$ ` u: U2 W<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
# g# s3 x* j) p y<?php } ?>
9 W% U- ?% U% b6 a0 A* ~</select>
Y# O9 f: F+ Z2 }$ H- \</p>5 W! u, b6 i% A, }; K; `
$ a1 }8 J/ I, H, S; n
<?php5 d- N5 u9 M- x* h% h
break;
) G T: {( k# w- Pcase 'textarea':. c4 B' i1 B; s
$valuex = $value['id'];7 G9 Z4 m+ g( q" @4 m1 J$ ~* ^% F N
$valuey = stripslashes($valuex);
% Q2 A% ^4 f. K: O7 m9 u* H$video_code = get_settings($valuey);: \' _6 r q. v3 u# P4 C
?>
) t4 M6 f9 Q9 }- Y% \7 ^; P
) ~ _2 v, b/ r$ c# E X* Y<div class="description"><?php echo $value['name']; ?></div>
8 ~9 X5 N5 L4 Q<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
$ {& R5 e' c' q ?, X
/ b$ `6 v8 s$ W6 \4 B9 pelse { echo $value['std']; } ?></textarea></p>
: h4 C$ k: {. ?. Q5 H+ y" k; j' R5 ?! B2 C4 v1 f2 j: R
<?php
3 d* `& R8 H& G' vbreak;# _7 Q) i; h% M) E# w$ z+ C
case 'close':
( v6 ~: v! p' Y5 b7 K. T?>/ }1 ], j& g, ^/ i; V' f
! p! I. p5 u6 f9 Q/ U, E: @<div class="clearfix"></div>
& P3 U% C4 @6 d" r2 @8 r2 b</div><!-- OPTION SAVE END -->) L( ~& V/ W+ E, V
: w/ G6 q7 N" [' f: |<div class="clearfix"></div>
9 D( u8 n; H! X</div><!-- GET OPTION END -->
7 s* @5 f( [* D! Y- y5 {, y3 h# I- ]4 }" }! J7 r
<?php
7 ?) \" |4 ]6 r! U7 Y' ebreak;
2 I# l0 c& j: I1 G) A0 v% odefault;
j. M$ G4 _& r% O; }/ x?>5 e6 \* B' P8 _+ [7 ~( g
5 ?, c/ t; Q% g5 x5 K' p, z# f3 a( T# \8 M# b# s& D
<?php
# L1 B+ o+ i6 @9 V+ nbreak; } ?>
0 T2 l1 n" K& u
' v1 F/ `2 ~. Q( a6 k, }+ @% I7 \<?php } ?>
) r- }7 R5 u- N& Z+ ^! n0 Q( Z/ `( h, x$ E7 k
<p class="save-p">
) M. b) r T2 D6 O8 r<input name="save" type="submit" class="sbutton" value="Save Options" />
1 [# l) |6 Z/ y<input type="hidden" name="action" value="save" /> P! b8 ~- S, `
</p>
$ ^/ S( ~7 h* Z: Y</form>' ~# o5 n1 j9 k: x4 C& m: ^ W2 i
0 r2 i1 u" \8 B6 f& I
<form method="post">
' K# X( D% G9 c- s% ^<p class="save-p">2 r& m- ~, o' F
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
4 _, f, Z9 F. E6 M, o2 S4 S5 b2 d6 x<input type="hidden" name="action" value="reset" />( u& Z3 ^4 f6 Z' N# x" v' l& t
</p>
- t n! U; c K3 w" h# l</form>% t; l, _" C& C% w1 @! ]6 s
* L" Y) s& x' e0 C0 C( ?3 r0 h</div><!-- ADMIN OPTIONS END -->0 Y8 ]: Z& I- N8 M% m
5 \' {7 l, E8 z( H2 @' _% g<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }4 F0 b0 v; S7 G7 F) ~* N
' T# u$ d) K" X9 ffunction mytheme_admin_register() {4 Z" R; w$ @5 H+ l7 P
global $themename, $shortname, $options;( ~+ r# r: y3 R% \ d
if ( $_GET['page'] == basename(__FILE__) ) {
! E. A% w6 u" w/ Z4 A0 Aif ( 'save' == $_REQUEST['action'] ) {
" ?) A& Q& L/ K1 `+ a( Uforeach ($options as $value) {
- v1 c) {5 x# a* {/ U, i+ V* I" Vupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
" {4 _9 V, J6 x6 wforeach ($options as $value) {
4 l+ N. A9 T kif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
+ E! Z3 J' J7 @! q) f" d# U# Theader("Location: themes.php?page=functions.php&saved=true");9 R' L8 ]$ b }; B# S
die;0 a" n3 t# q/ f) f& `
} else if( 'reset' == $_REQUEST['action'] ) {
) ^* r. r9 g ]; T) hforeach ($options as $value) {# O; [7 i# _$ L' f4 n N, @
delete_option( $value['id'] ); }8 {0 E- n! N$ M! Z; b
header("Location: themes.php?page=functions.php&reset=true");" T% @. V, }9 z8 e) |6 F8 f
die;
/ l! N# m" r' m" E( L# E}
F; G+ _2 `4 R9 b6 u# q0 B}8 _8 ~# ` h# E
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
$ S p& n, }/ b; @) K} k# c0 M' G9 q+ z% |
5 R3 Q7 g- I7 I. e2 h; o4 ^2 ?, ofunction mytheme_admin_head() { ?>
1 a/ i% k# u$ x1 ]8 {<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" /> w3 F. @1 P& l" t8 E+ e' Q; q
<?php }
8 J$ r8 _8 k( A j0 A |
|