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