|
|

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