|
|

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