|
|

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