|
|

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