|
|

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