|
|

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