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