|
|

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