|
|

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