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