|
|

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