|
|

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