|
|

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